Git 忽略剩余的 merge 冲突

标签 git git-merge

在我解决了所有我关心的 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/

相关文章:

git - 如何确定哪个父级是 Git 中 merge 提交的第一个父级

Git 描述没有提供预期的标签

git - git 服务器到底是什么?

git - 如何将 git 分支声明为 merge 而不采用其中的更改?

git - merge 到特定的提交

git - 有或没有快进 merge 的功能分支?

Git 将两条提交消息 merge 为一条消息

git - git commit 和 git commit-tree 有什么区别

Git 推送,将消息流式传输到客户端

git - 在 Gerrit 中,如何防止提交不是完全最新的补丁集?