How to push tag to specific branch in gerrit

Frank picture Frank · Jul 30, 2013 · Viewed 31.2k times · Source

I have a branch called v2.0 in gerrit. Now I want to the current stat of this branch as v2.0.1.

In my local repository I checked out the branch, then added the tag using

git tag v2.0.1

Now I'm trying to push that to gerrit, but I'm not sure how. I tried this:

$ git push origin v2.0.1 HEAD:refs/heads/v2.0
! [remote rejected] v2.0.1 -> v2.0 (prohibited by Gerrit)

How can I push the tag to gerrit?

Answer

Frank picture Frank · Jul 31, 2013

After some googling, I found the answer:

gerrit accepts only annotated tags. It's quite straightforward to create and push an annotated tag:

git checkout v2.0
git tag -am "Adding v2.0.1 tag" v2.0.1
git push origin v2.0.1 HEAD:refs/heads/v2.0