0

I have a new project on gerrit named my_project and I am its integrator.

I do the following:

git clone ssh://gerrit.local.server.com:29418/my_project
cd my_project
git remote add bla ssh://gerrit.local.server.com:29418/my_project
git fetch bla
echo 111 > try.txt
git commit -as

And all these tries fail with no permmision error (I am an integrator and I use with the right user, RSA key and email in all the configs files):

git push origin master
git push ssh://gerrit.local.server.com:29418/my_project refs/heads/* refs/tags/*

What do I miss here?

0x90
  • 39,472
  • 36
  • 165
  • 245
  • http://stackoverflow.com/questions/10461214/why-do-git-push-gerrit-headrefs-for-master-instead-of-git-push-origin-master – 0x90 Jun 19 '13 at 15:58

1 Answers1

1

Are you trying to bypass review? If not, you need to push to refs/for/master, not master:

git push origin HEAD:refs/for/master

If you are trying to bypass review, you need to make sure you have write permissions on refs/heads/master

Brad
  • 5,492
  • 23
  • 34
  • what is the difference between `HEAD:refs/for/master` and `refs/heads/master` – 0x90 Jun 05 '13 at 18:50
  • 1
    `refs/for/master` is a Gerrit-specific trick. `refs/heads/master` is the full git notation for the `master` branch. When you specify a branch name, `refs/heads/` is prepended behind the scenes if you don't specify a ref space. `refs/for/[blah]` is a namespace Gerrit uses to indicate 'create a code review for the [blah] branch. Once the review is approved/submitted, it gets put on the `refs/heads/[blah]` branch. – Brad Jun 05 '13 at 19:48