在我解决了所有我关心的 merge 冲突后,我想 merge 而不考虑所有剩余的冲突。我希望 git 保留我要 merge 到的分支中的文件(--ours
策略)。
我该怎么做?
最佳答案
提交二进制文件是个坏主意,但我会向您解释如何制作您需要的东西
你在 branch special 并且你已经完成了 merge ,你已经修复了一些冲突并且你想让其他人喜欢分支 master 所以你应该做这个
git reset --mixed (reset the index but not the working tree; changes remain localy but not used in the commit)
git add {files those you have fixed the conflict}
git commit
git reset --hard
git merge --strategy=recursive -X theirs origin/master
{merge twice and you take files as in branch origin/master}
如果更改在本地存储库中,则使用 master,如果更改在远程存储库中,则使用 origin/master
关于Git 忽略剩余的 merge 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14032695/