Reputation: 10828
On Github, how do I restrict some folders or files on a private repo?
I do not want to give developers full access to everything in a repo.
Upvotes: 5
Views: 5519
Reputation: 56432
You can't.
If you give someone the push permission, he will be able to push whatever he want.
If you want someone to have a partial access, you have many choices:
If you don't want him to have read access on other files, then the best way to go is to create a separate git repository for him, and use it as a submodule of your own git repository. See here: https://git-scm.com/book/en/v2/Git-Tools-Submodules
Upvotes: 2