14

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?

oberlies
  • 11,503
  • 4
  • 63
  • 110
coanor
  • 3,746
  • 4
  • 50
  • 67

2 Answers2

17

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.

dunni
  • 43,386
  • 10
  • 104
  • 99
  • 1
    Actually, I have set the '''Read Access''' to permission +1, and this permission only allow group members to clone/pull repository but not allow them to upload their modifications. Once I set this to permission +2, the group members can upload their changes now. – coanor Dec 15 '11 at 00:53
  • Do you use Gerrit 2.1.x or older? My description is for Gerrit 2.2.x and newer, in that versions the permission scheme has changed. – dunni Dec 15 '11 at 08:02
  • Mybe, I always using the newest release software :) – coanor Oct 23 '12 at 17:31
0

adding following line in Git config file worked for me:

push=HEAD:refs/for/master

Venu Gopal Tewari
  • 5,672
  • 42
  • 41