Reputation: 3567
In a process where each change is reviewed with gerrit, I have local branches for each ticket (e.g. trac-0815). Every now and then, I need to rebase my changes before they can be applied to the main branch.
When done on my local branch, I can follow this workflow:
This creates a new patch set in gerrit. The information that this is only a rebase is lost, however.
Alternatively, gerrit offers a "rebase" button. This also creates a new patch set, but immediately adds the information about a rebase, e.g. "Patch Set 2: Patch Set 1 was rebased". Obviously, this is preferable. But how do I now sync my local branches? When I do:
I get a merge commit in my history, which is something, I'd like to avoid. In principle, I could rebase the local branch separately, but that appears to be tedious and error prone. What I'd like to have is a pull command that overwrites the last commit.
Upvotes: 2
Views: 4481
Reputation: 22411
A easy way to do that is to delete your local branch and recreate it pointing to the Gerrit commit:
The #1 can be copied from Gerrit > Change > Download > Checkout
Upvotes: 3