How to hide a branch or folder?

I have many projects that I want to release open source, but they use resources and assets that are not licensed in a way to include them in open source. I’m trying to find solution to allow me to release them.

I’m hoping there is a way to make a specific branch public from a private repo. Or that I can make a public repo, but hide certain folders so when someone gathers them, they cannot get certain files/folders. But at the same time, if someone with permissions downloads the repo, they get everything.

Is there a way to do this? I’m open to other ideas. This is focused around Unity apps if that has any bearing.

  • Thanks!

That sounds primarily like a legal problem, not a technical one.

A repository is public or private as a whole, you cannot make parts of it private. The closest you could do would be to have a second, private repository and push the branch(es) containing confidential data only to the second one, while mirroring public branches between them.