这是一个 git rebase/merge/continue 场景,需要更方便的方法:
Given: a file that has changes in both the present branch and the branch being rebased onto.
Already performed: a manual merge of the files.
Complication: the following command seems to be required multiple times: it finds only a small portion of the "required" (according to git) changes to be merged at one shot:
git rebase --continue
Desired outcome: have Git simply "accept" the file that I have in the existing branch.
What has been tried: after the initial
rebase
the original version of the file was copied on top of the merge conflicted version.What happened: after
git rebase --continue
the file is still conflicted - but with a different set of merge conflicts. This process is repeated now a few times and not done yet.
我们可以直接接受我更新的文件吗?
最佳答案
您有多个冲突的原因是您要重新定位多个提交,其中几个(全部?)包含对文件的冲突更改。您不能跳过这些冲突解决步骤,因为您正在创建多个新提交,并且每个提交都需要一个特定版本的文件,处于已解决状态。
您可以像以前一样继续,也可以选择压缩您的提交,这样就无需生成多个提交而只 merge 一次。
关于git - 在初始 merge 冲突后强制 git rebase 接受我的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40002089/