Ventu
Ventu

Reputation: 800

Gerrit: how to rebase on remote changed commit under review?

I think i have a sort of understanding problem.

For example: I have three commits which looks like the following on the remote repository:

Commit A: Already merged
Commit B: Under review, rebased over the webinterface from an other user, based on commit A
Commit C: Under review, based on commit B

My local repository looks like this:

Commit A: Already merged
Commit B: Under review, based on commit A
Commit C: Under review, based on commit B

So now the problem is, i do not know how i can get the new, rebased, version of commit B. If i try git pull or git fetch it git tells me, there is nothing to update, but if i try to upload a new version of B, I get an error because of the differences beteween my local B and the remote B.

Upvotes: 4

Views: 4238

Answers (1)

sschuberth
sschuberth

Reputation: 29867

The easiest thing probably is to look at commit B in the Gerrit web UI, and then (provided that you are using the "Change Screen 2" layout) look at the upper right corner for the "Download" drop-down menu, and click on the copy-to-clipboard icon next to "Checkout". If you paste this to the command line, Git will checkout out commit B in "detached HEAD" mode. Note that this will not give you commit C, but I guess that is what you want.

Upvotes: 5

Related Questions