合并冲突在调用mergetool后自动消失

时间:2014-07-02 11:45:34

标签: git

在我正在使用的代码库中,当我执行拉动时,Git警告合并冲突并发出一条错误消息:

Automatic merge failed; fix conflicts and then commit the result.

所以,然后我运行'git mergetool'。它给出了一个合并工具候选列表,然后是一条消息:

Merging fileA
Normal merge conflict for fileA
{local}: modified file
{remote}: modified file
Hit return to start merge resoution tool (kdiff3):

当我点击返回时,它立即返回到命令提示符。如果我现在执行git citool,我看到文件已正确合并。这似乎只发生在Git可以很容易地自动合并文件的情况下,即相邻的行被修改,但是在2个回购中没有触及相同的行。所以我的问题是为什么我首先得到“自动合并失败”的消息?

点击'return'是否会激活kdiff3,然后在没有我介入的情况下自动解决冲突?如果是这样,有没有办法配置Git,我甚至没有得到第一个'自动合并失败'消息?

我认为kdiff3只是为用户提供GUI手动合并而没有任何自动解析功能。

1 个答案:

答案 0 :(得分:2)

Is it the case that hitting 'return' activates kdiff3 which then resolves the conflict automatically without my intervention?

是。 kdiff3尝试自动解决冲突。 Git并不那么聪明。 Git不是为了解决冲突。它依赖于第三方应用程序。