如何使用gitolite将开发人员限制为仅限开发分支:

时间:2013-10-10 17:36:18

标签: git version-control gitolite

我们正在寻找使用gitolite和git但我们正试图找到一种方法来阻止开发人员将代码推送(提交)到repo的发布分支

我们希望仅允许开发人员访问主分支和开发分支。这可以用gitolite完成吗?怎么样?

1 个答案:

答案 0 :(得分:2)

是的,这正是gitolite的用途。成为开发人员小组:

@developers = <list of developers>
@releasers = <list of people allowed to push to release branch>

然后设置访问规则:

repo <reponame>
    RW release = @releasers      # allow @releasers access to release branch
    - release = @developers      # deny @developers access to release branch
    RW master = @developers      # allow @developers access to master branch
    RW development = @developers # allow @developers access to development branch
    - = @all                     # deny all other permissions

或者你认为合适的事情更复杂。