Feature Request: Allow Public and Private Folders in Same Repository #189158
Replies: 1 comment
-
|
Git doesn't treat a repository like a standard file system where you can just slap a permission setting on a folder. It tracks snapshots of the entire directory tree. Every commit generates a cryptographic hash that relies on the exact state of all files and folders included in that commit. If GitHub allowed you to "hide" certain folders from public users, the hashes wouldn't match up for them. If a public user tried to clone the repo, their Git client would see missing data, and the whole cryptographic chain would break. GitHub would essentially have to invent a completely new version control system, or drastically fork Git, to make this work natively. Since a single mixed-visibility repo isn't feasible right now, here are the standard ways developers handle this exact scenario:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
General
Body
Hello GitHub Team,
Currently repository visibility applies to the entire repository, meaning a repo must be either fully public or fully private.
It would be very helpful if GitHub allowed some folders or files inside a repository to be private while the rest of the repository remains public.
This would allow developers to share open-source code while keeping sensitive parts (such as internal modules or configuration) private.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions