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

只谈情不闲聊 提交于 2019-12-08 05:46:14

问题


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.)


回答1:


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


来源:https://stackoverflow.com/questions/53209237/how-to-solve-merge-conflict-in-a-approved-review-in-gerrit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!