git — locking master branch for some users?

耗尽温柔 提交于 2019-12-02 20:39:27
ephemient

See man githooks: In the shared repo, you can create a $(git rev-parse --git-dir)/hooks/pre-receive or $(git rev-parse --git-dir)/hooks/update script that verifies what your users are trying to push to which refs. Git comes with a update-paranoid example hook enforcing per-ref ACLs.

My low level approach would simply be to let the RM be the only one with SSH keys to push to the repository everyone else use as the master baseline. That way, nobody but the RM can push to master - yet everybody can work since they have their own local development branches and devs can share among themselves the branches they like.

The next step is to make a cooking pot tester for the things that will go into master soon. This pot is normally called next or dev. The idea is, that the more impact a branch has, the longer it cooks before a merge to master. This gives the RM full control over what branches should graduate and still gives everyone a heads-up.

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