禁止 Gerrit 推送到 refs/for/master
我昨天更新了所有项目访问权限,人们说他们今天早上无法将更改推送到存储库。在我恢复访问权限后,他们仍然无法将更改推送到存储库,只有clone
工作正常。当将更改推送到远程存储库时,它说:
![remote rejected] HEAD -> refs/for/master (prohibited by Gerrit)
我们的所有其他项目都继承自所有项目的访问权限,我将访问权限更新为最低级别(即匿名 > 可以将分支推送到 refs/heads/*
) 进行测试,但我发现管理员也无法将更改推送到存储库!
是否还需要添加其他设置?
I have updated the All Project access permission yesterday, people says that they cannot push changes to repository this morning. After I recovered the access permission, they still cannot push changes to repository, only clone
works fine. While push changes to remote repository, it says that:
![remote rejected] HEAD -> refs/for/master (prohibited by Gerrit)
All our other projects are inherit from All project's access permission, I updated the access permission to the lowest level (i.e. Anonymous can push branch to refs/heads/*
) for test, but I find that the Administrator cannot push changes to the repository too!
Is there any other settings need to add?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要推送到审阅分支(即
refs/for/*
),您必须为参考refs/for/refs/*
设置“推送”权限。然后,您还需要参考refs/heads/*
的Label Code Review
、Label verify
和Submit
权限进行实际的代码审查。如果您不想进行代码审查,而是直接推送到分支,那么您的权限是正确的,但您还必须推送到
refs/heads/master
,而不是refs/对于/master
。To push to the review branches (i. e.
refs/for/*
), you have to set the permission "Push" for the referencerefs/for/refs/*
. You then also need the permissionLabel Code Review
,Label verified
andSubmit
for the referencerefs/heads/*
to do the actual code review.If you don't want code review, but push directly to the branch, then your permissions are correct, but then you also have to push to
refs/heads/master
, and notrefs/for/master
.在 Git 配置文件中添加以下行对我有用:
push=HEAD:refs/for/master
adding following line in Git config file worked for me:
push=HEAD:refs/for/master