git - 为某些用户锁定主分支? [英] git -- locking master branch for some users?
问题描述
我想迫使其他团队成员不能在主分支上工作,而是在开发分支上工作。我们有一个中央git-repository,在这里我们推动我们的工作。我想知道是否有可能阻止用户将更改推送到主分支,但只允许某些用户这样做。
我想要有以下工作流程
这是可能的,我该如何做到这一点?
请参阅 man你可以创建一个
$(git rev-parse --git-dir)/ hooks / pre-receive $ c> $ c>或
$(git rev-parse --git-dir)/ hooks / update
脚本验证您的用户试图推送哪些文件。 Git附带了 update-paranoid 示例挂钩强制执行每个ACL。
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 to know if it's possible to block users from pushing changes to the master-branch but only allow certain users to do so.
I would like to have the following "workflow"
- development is always only done with a development-branch
- the release-manager is responsible for the master branch and only he is allowed to merge stuff from a development branch into the master and push it to the master-branch on the central repository to.
Is this possible and how can I achieve this?
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.
这篇关于git - 为某些用户锁定主分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!