[Development] gerrit : what went wrong (was: pointers to use it cleverly/efficiently?)

Welbourne Edward edward.welbourne at theqtcompany.com
Wed Mar 30 14:55:23 CEST 2016

René J.V. Bertin said:
> I'm not exactly familiar with using branches; I just tried to create
> one, apply a patch, commit it and then push to gerrit.  That was a bit
> of a failure; the commit to my local branch was also applied to the
> branch I thought I'd branched off, and the push to gerrit was refused:
> %>  git push gerrit
> fatal: You are pushing to remote 'gerrit', which is not the upstream of
> your current branch '5.6.0', without telling me what to push
> to update which remote branch.
> Exit 128

That sounds like you didn't do what you thought you did.  If you create
a branch with

$ git checkout -b topic origin/upstream

then git shall know that your topic branch is based on origin's upstream
branch; a git push origin will then know to push topic to upstream.
However, that's not the workflow for Gerrit, where you push to a
refs/for/upstream instead of directly to upstream (as others have
pointed out; your

>  ! [remote rejected] 5.6.0 -> 5.6.0 (prohibited by Gerrit)

was caused by this).

In any case, the error message indicates you currently have branch 5.6.0
checked out, where you thought you had a topic branch checked out.  If

$ git branch topic [base]

then it *creates* the branch, topic (starting at base, if given, else at
your present HEAD) but *does not* check out that branch; for that use

$ git checkout -b topic [base]

If you used git branch and then made your changes, then you made your
changes on your original branch, presumably 5.6.0, not on the branch
you'd created and not checked out.  With git checkout -b, you checkout
the newly-created branch and won't be making changes to the base.

> %> git push gerrit 5.6.0:5.6.0
> X11 forwarding request failed on channel 0

This smells like you've got some default ssh config enabling X11
forwarding: you should probably turn that off for the gerrit server !


More information about the Development mailing list