Let user push only to his own branch
Does anyone know how one can restrict push to some git repository branch based on “pusher’s” public key? Example: Alice wants to push changes to branch named “Bob” but push is refused on the server because her private key does not correspond to the public key stored in branch “Bob”. Only Bob has the corresponding private key and thus can push to “Bob” branch.
- Setting up personal branch permissions using gitolite
- New user permission denied for accessing git repository
- Permissions issues with Azure Websites?
- Git pushing to remote GitHub repository as wrong user
- Changing the permission of file already added to git
- Which user should I choose when cloning Git repo into a non-user folder?
One Solution collect form web for “Let user push only to his own branch”
Have a look at Gitolite which allows this fine level of control.
Personally – I think that if you need this level of control in your repository, you’re perhaps doing it wrong, but I suppose you have your reasons.
If you want to have branches that are read only to everyone but the pusher, why not just let Alice and Bob have their own public repositories that only they can push to – if you want to see what is on their branch then pull from their repo.
The difference here is that rather than have one repo with lots of private branches – everyone has their own repo to push to but you can all pull from each other. Git is a distributed system, after all.