起初,我知道这个问题How do I tell git to always select my local version for conflicted merges on a specific file?但是这篇文章对我没有帮助,由于我的声誉,我无法添加任何评论。
http://git-scm.com/book/en/Customizing-Git-Git-Attributes建议将合并策略设置为我们的路径,而不是设置自定义合并驱动程序。
添加自定义合并驱动程序返回退出代码 0 的好处和区别是什么?
我的仓库顶层有一个 .gitattributes 文件:
pom.xml merge=ours
但是,当我将两个分支与已更改的 pom.xml 文件合并时,无法解决合并问题:
$ git merge origin/master
Auto-merging pom.xml
CONFLICT (content): Merge conflict in pom.xml
Automatic merge failed; fix conflicts and then commit the result.
我得到一个标准的合并冲突结果:
<pom>
<<<<<<< HEAD
<version>0.88-SNAPSHOT</version>
=======
<version>0.87.0</version>
>>>>>>> origin/master
</pom>
我究竟做错了什么?