Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gerrit push to refs/for/master prohibited

Tags:

git

push

gerrit

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?

like image 715
coanor Avatar asked Dec 13 '11 02:12

coanor


People also ask

Why did my Push fail with'prohibited by Gerrit'?

For new users it often happens that they accidentally try to bypass code review. The push then fails with the error message 'prohibited by Gerrit' because the project didn’t allow to bypass code review.

Why can't I bypass code review in Gerrit?

For new users it often happens that they accidentally try to bypass code review. The push then fails with the error message 'prohibited by Gerrit' because the project didn’t allow to bypass code review. Bypassing the code review is done by pushing directly to refs/heads/* (e. g. refs/heads/master) instead of pushing to refs/for/*

What does it mean when a push is not allowed?

prohibited by Gerrit This is a general error message that is returned by Gerrit if a push is not allowed, e.g. because the pushing user has no sufficient privileges. In particular this error occurs: if you push a commit for code review to a branch for which you don’t have upload permissions (access right 'Push' on refs/for/refs/heads/*)

How does Git push work in Gerrit?

Gerrit follows the standard Git workflow pattern, in that you use the git push command to copy your files from your local machine to the remote repository. However, instead of your changes going directly into the repository, they go into a specific namespace.


1 Answers

To push to the review branches (i. e. refs/for/*), you have to set the permission "Push" for the reference refs/for/refs/*. You then also need the permission Label Code Review, Label verified and Submit for the reference refs/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 not refs/for/master.

like image 191
dunni Avatar answered Oct 26 '22 17:10

dunni