Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

gerrit

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.

like image 318
Ventu Avatar asked Oct 14 '25 08:10

Ventu


1 Answers

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.

like image 104
sschuberth Avatar answered Oct 16 '25 23:10

sschuberth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!