1

I'm currently developing a new feature in a new branch.

As the development has several commits and the original "master" branch is having its own commits, I want to rebase my work periodically.

I know how to do that using Git (for example, Rebasing remote branches in Git), but in my company we are using Gerrit.

As all the commits are tracked by Gerrit, I'm able to rebase my branch locally and push all my commits, but I'm unable to push it finally to the real repository because Gerrit doesn't allow me to do that.

In Gerrit, I see a warning saying that I cannot merge.
Do you know how I can accept my changes in Gerrit and get my feature branch rebased in remote?

Community
  • 1
  • 1
JoseLSegura
  • 3,510
  • 3
  • 16
  • 25
  • Based on [this documentation](https://gerrit-documentation.googlecode.com/svn/Documentation/2.1.7/error-non-fast-forward.html), Gerrit should be allowing you to fast-forward the remote branch with your local branch. I would guess that either you botched the rebase, or the admin has configured Gerrit to not allow fast-forwarding. – Tim Biegeleisen Nov 27 '15 at 09:53
  • I finally did that rebase without major problems. I guess that the sysadmins upgraded the Gerrit version, because I was unable in the past. My problem now is that if I submit my changes to this private branch and then rebase the branch, all the commits must be re-reviewed, and initially I will get error for each commit because the change-id of every commit will be referring to a closed review. Maybe it will be better start using "merge" instead rebase... – JoseLSegura Dec 02 '15 at 22:56
  • 1
    You will find that many repositories which host Git (e.g. GitHub) are not very supportive of rebase. If you fight to use rebase, you might win but don't expect Gerrit to be happy about it. – Tim Biegeleisen Dec 03 '15 at 00:19

0 Answers0