Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve merge conflict in a approved review in gerrit?

I made a change in gerrit which was code reviewed and after 7 revisions approved. But, now it cannot be merged and trying to rebase in gerrit website is not working due to merge conflict. How can I resolve this merge conflict and merge the same approved change and not create a new one. (Full steps from cloning the repo would be appreciated.)

like image 366
Arshak Anj Avatar asked Nov 08 '18 13:11

Arshak Anj


1 Answers

1) Clone the Gerrit repository

git clone https://USER@GERRIT-SERVER/a/REPO-FULL-PATHNAME

2) Go to the change page on Gerrit and copy the checkout patch command

git fetch https://USER@GERRIT-SERVER/a/REPO-FULL-PATHNAME refs/changes/XX/YYYYY/Z && git checkout FETCH_HEAD

3) Rebase the change

git rebase origin/BRANCH

4) Solve the conflicts

git mergetool

5) Continue the rebase

git rebase --continue

Repeat the steps 4 and 5 until the end of conflicts

git commit --amend

Note: Keep the same Change-Id

6) Send the new patchset to Gerrit

git push origin HEAD:refs/for/BRANCH
like image 168
Marcelo Ávila de Oliveira Avatar answered Oct 24 '22 11:10

Marcelo Ávila de Oliveira