我真的很困惑。我已经阅读了相当多的例子,并尝试了所有这些例子。最基本的例子可以正常工作,但每当我尝试转移到更复杂的内容时,一切都崩溃了(即使我直接复制示例)。另外,记录一下,我的gitolite版本是3,服务器会显示:
this is gitolite@ubuntuserver running gitolite3 v3.1-2-g3eefc06 on git 1.7.9.5
所有这些说的,我正在努力实现的(我认为)相对简单。我有一组初级开发人员 [@scrubs],我只希望他们创建并提交到新分支,并能够阅读/拉取主分支。这样我就可以在合并之前审查他们的代码。
我有一组高级开发人员 [@vets],我希望他们完全自由。
我的配置文件如下:
@scrubs = al ted matthew
@vets = kevin will guy
@offlimitbranches = master$
repo gitolite-admin
RW+ = @vets matthew
repo dawebsite
RW+ = @vets
- @offlimitbranches = @scrubs
RW+ = @scrubs
R @offlimitbranches = @scrubs
R = daemon
option deny-rules = 1
dawebsite "Owner" = "This is THE site"
我注意到在添加了以下内容之前,拒绝功能完全没有起作用:
option deny-rules = 1
在其中的20个例子中,我认为只有一个例子是正确的(有点牢骚,请原谅我的挫败感)。
使用当前设置,兽医可以按预期执行任何操作。
护士无法将代码推送到主分支,也无法从主分支拉取代码(我认为这是因为它会尝试匹配可能的第一个规则?)。同时,护士也不能将代码推送到任何非主分支,也不能推送新创建的分支。每次尝试都返回相同的消息“FATAL:[R/W] any dawebsite matthew DENIED by refs/heads/master$”。
我已尝试使用master,master$,@offlimitbranches甚至是refs/heads/master来引用分支,但均未成功。
如果有人能够帮助我澄清这个问题,我会非常感激。
更新**
经过一些尝试,我发现如果将matthew从护士组中移除,并直接操作他,则可以成功。
- master$ = matthew
RW+ = matthew
如果他切换到一个新分支并尝试以下操作:(感谢VonC关于日志的提示)
git pull origin newBranch
git push origin newBranch
每个都返回错误。
拉(PULL):ARGV=matthew SOC=git-upload-pack 'dawebsite.git' FROM=172.24.1.198
access(dawebsite, matthew, R, 'any'),-> R any dawebsite matthew DENIED by refs/heads/master$
trigger,Writable,access_1,ACCESS_1,dawebsite,matthew,R,any,R any dawebsite,matthew DENIED by refs/heads/master$
R any dawebsite matthew DENIED by refs/heads/master$<<newline>>(or you mis-spelled the reponame)
PUSH:
ARGV=matthew SOC=git-receive-pack 'dawebsite.git' FROM=172.24.1.198
access(dawebsite, matthew, W, 'any'),-> W any medehrdev matthew DENIED by refs/heads/master$
trigger,Writable,access_1,ACCESS_1,dawebsite,matthew,W,any,W any dawebsite matthew DENIED by refs/heads/master$
W any dawebsite matthew DENIED by refs/heads/master$<<newline>>(or you mis-spelled the reponame)
似乎我的所有分支都与 master$ 引用匹配,这是因为它们全部派生自 master 分支吗?
.gitolite
目录中),它可以帮助您了解为什么 gitolite 选择拒绝该命令。 - VonC