如何解决Gerrit批准的审阅中的合并冲突?

问题描述:

我对Gerrit进行了更改,该更改已通过代码审查,并在经过7次修订后获得批准.但是,现在无法合并,并且由于合并冲突,试图在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.)

1)克隆Gerrit存储库

1) Clone the Gerrit repository

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

2)转到Gerrit上的更改页面,并复制checkout patch命令

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)重新设置更改

git rebase origin/BRANCH

4)解决冲突

git mergetool

5)继续进行变基

git rebase --continue

重复步骤4和5,直到冲突结束

Repeat the steps 4 and 5 until the end of conflicts

git commit --amend

注意:保留相同的更改ID

Note: Keep the same Change-Id

6)将新补丁集发送给Gerrit

6) Send the new patchset to Gerrit

git push origin HEAD:refs/for/BRANCH