git 使用我的更改解决拉取时的合并冲突
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13235875/
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-19 07:43:07 来源:igfitidea点击:
Resolve merge conflicts on pull using my changes
提问by Mass
I want to pull a project and resolve merge conflicts using my changes. How can I do this?
我想拉一个项目并使用我的更改解决合并冲突。我怎样才能做到这一点?
回答by jbowes
Use the recursivemerge strategy with the oursoption:
使用递归合并策略和我们的选项:
git merge -s recursive -X ours branch_to_merge
or
或者
git pull -s recursive -X ours
For any conflicts, it will use the hunk that comes from your branch. See the git mergeman page for more details.
对于任何冲突,它将使用来自您的分支的大块。有关更多详细信息,请参阅git merge手册页。