git — locking master branch for some users?

前端 未结 2 1598
予麋鹿
予麋鹿 2021-02-01 23:02

I would like to force other team-members to not work on the master-branch but on a development branch. we have a central git-repository where we push our work into. i would like

2条回答
  •  北恋
    北恋 (楼主)
    2021-02-01 23:24

    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.

提交回复
热议问题