Gertritis is not working. Removed rejected, forbidden by gerrit

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

 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 already went to the gerrit website and added refs/head/* to project/access refs/head/* Create link privileges for all users.

+8
git github ssh gerrit
source share
3 answers

In my experience, you need the following group permissions to import the entire gerrit repository - basically permissions to push everything into the gerrit repository:

  • links / chapters / *
    • create link
    • auto ad id
    • forge commander id
    • push
    • push merge commit
    • push annotated tag
  • links / tags / *
    • create link
+6
source share

In addition to adding the Create Reference privilege, you also need to make sure that you have the direct push / force push privilege - creating a link involves creating a new branch, while updating an existing branch (namely origin/HEAD and origin/master ) will require a direct push privilege / force push (I saw that gerrit refers to this both as a direct and a forced push in the documentation).

+2
source share

in your git project, use git config --list to see your username .name, user.email is equal or not the same as your local gerrit username or email. They must be the same., Use git config user.name XXX.

finally. git config remote.origin.push refs / heads /: refs / for / so you can use git push origin master

0
source share

All Articles