Git忽略剩余的合并冲突

dan*_*jar 13 git git-merge

在我解决了我关心的所有合并冲突之后,我想合并而不管所有剩余的冲突.我想让git保留我要合并到的分支中的文件(--ours策略).

我怎样才能做到这一点?

elh*_*ɥןǝ 15

提交二进制文件是一个坏主意,但我会向您解释如何制作您需要的内容

你在分支特殊,你已经完成了合并,你已经解决了一些冲突,你想让其他人喜欢在分支主人,所以你应该这样做

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}
Run Code Online (Sandbox Code Playgroud)

如果更改在本地存储库中,则使用master,如果更改位于远程存储库中,则使用 origin/master