Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gerrit push not working. Remote rejected, prohibited by gerrit

I am trying to add an existing repo to gerrit. I create an empty project and have tried pushing it (git push ssh://admin@localhost:29418/project *:*). I get this error message in return:

Counting objects: 14, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 384 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 3 (delta 1)
remote: Resolving deltas: 100% (1/1)
remote: Processing changes: refs: 3, done    
To ssh://admin@localhost:29418/project
 ! [remote rejected] origin/HEAD -> origin/HEAD (prohibited by Gerrit)
 ! [remote rejected] origin/master -> origin/master (prohibited by Gerrit)
 ! [remote rejected] origin/ref/for/master/testing -> origin/ref/for/master/testing (prohibited by Gerrit)
error: failed to push some refs to 'ssh://admin@localhost:29418/project'

I have already gone to the gerrit site and under project/access added refs/head/* Create Reference privileges for all users.

like image 609
Vis Avatar asked Jul 02 '15 22:07

Vis


2 Answers

From my experience you need the following group permissions to import an entire repository to gerrit -- basically permissions to push everything to the gerrit repo:

  • refs/heads/*
    • create reference
    • forge author identity
    • forge committer identity
    • push
    • push merge commit
    • push annotated tag
  • refs/tags/*
    • create reference
like image 151
volker Avatar answered Oct 25 '22 03:10

volker


In addition to adding the Create Reference privilege, you will also need to ensure that you have the direct push/force push privilege--creating a reference would involve creating a new branch, whereas updating an existing branch (namely, origin/HEAD and origin/master) will require the direct push/force push privilege (I have seen gerrit refer to this as both direct push and force push in the documentation).

like image 38
forkrul Avatar answered Oct 25 '22 02:10

forkrul