How to write a git hook to restrict writing to branch?

99封情书 提交于 2019-11-29 11:55:11

I think it could be possible to use such script but it is not the right place for rights management, it should be rather done on git server side. For example in gitosis you do this configuration in gitosis-admin repository in file gitosis.conf.

Security managed by a hook can be easily broken, only server can keep track of this things, please check documentation of your server for details how to restrict access.

For your requirement: "if code passes review, reviewer would merge it into the master branch."
You can try Gerrit Code Review: http://code.google.com/p/gerrit/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!