【发布时间】:2014-03-22 12:10:05
【问题描述】:
起初,我知道这个问题How do I tell git to always select my local version for conflicted merges on a specific file?,但这篇文章对我没有帮助,因为我的声誉,我无法添加任何 cmets。
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>
我做错了什么?
【问题讨论】:
标签: git merge git-merge gitattributes