Gerrit不小心引入了一些合并提交(配置为“必要时合并”选项),我想从历史记录中将它们删除。虽然我们使用Git进行团队协作,但在这种情况下,开发人员不会受到影响,因为他们在本地没有更改任何内容。
我在本地运行
On branch master Your branch and 'origin/master' have diverged, and have 7 and 9 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working directory clean
这正是我想要的(9个提交减去2个合并提交)。
当我尝试使用
The change could not be merged due to a path conflict. Please rebase the change locally and upload the rebased commit for review.
我做错了什么?
我在本地运行
git rebase -i
并且Git自动删除了Gerrit的合并提交。我仔细删除了每个提交消息中以前的Gerrit Change-Ids,并且Gerrit提交消息挂钩添加了新的Change-Ids。
git status
命令输出:On branch master Your branch and 'origin/master' have diverged, and have 7 and 9 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working directory clean
这正是我想要的(9个提交减去2个合并提交)。
当我尝试使用
git push origin HEAD:refs/for/master
推送到Gerrit时,没有错误。但是当我尝试在Gerrit Web界面上审查和提交时,我会收到以下错误:The change could not be merged due to a path conflict. Please rebase the change locally and upload the rebased commit for review.
我做错了什么?