开发者

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 开发者_JS百科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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜