Git 忽略剩余的合并冲突

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14032695/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 15:09:21  来源:igfitidea点击:

Git ignore remaining merge conflicts

gitgit-merge

提问by danijar

After I solved all merge conflicts I care about, I want to merge regardless of all remaining conflicts. I'd like git to keep the files from the branch I want to merge into (--oursstrategy).

在我解决了我关心的所有合并冲突后,我想合并而不考虑所有剩余的冲突。我希望 git 将文件从我想合并到的分支中保留(--ours策略)。

How can I do that?

我怎样才能做到这一点?

回答by elhadi dp ?p????

It is a bad idea to commit binaries, but i'll explain to you how to make what you need

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

you are in branch special and you have done a merge, you have fixed some conflicts and you want to let others like in branch master so you should make this

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

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}

you use master if changes are in your local repository, if changes are in distant repository, you use origin/master

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