我试图将合并策略添加到存储库中的.gitattributes文件中。但是当我将另一个分支与那个(不同的)文件合并时,它会导致合并冲突-自动合并失败。
这就是我想做的。
.gitattributes:
backend/library/project/config.php merge=ours分支机构:
在生产中,我有config.php'A,而在阶段中,我有config.php'B。
> git checkout production
> git merge staging
> Auto-merging backend/library/project/config.php
> CONFLICT (content): Merge conflict in backend/library/project/config.php
> Automatic merge failed; fix conflicts and then commit the result.我尝试将这一行添加到. .git/info/attributes中,并将引号添加到..merge="ours“中。
有人知道我做错了什么吗?(Git-版本为1.7.4.4)
发布于 2012-04-04 14:13:02
有两个很好的堆栈溢出响应可以解决这个问题:
How do I tell git to always select my local version for conflicted merges on a specific file?
和
.gitattributes & individual merge strategy for a file
我建议阅读第一个链接的最上面的答案。它很长,但非常详细,信息丰富。
https://stackoverflow.com/questions/9264701
复制相似问题