0

当我执行 git pull 时,我遇到了一些冲突,但我尝试使用 mergetool(代码比较)修复此冲突,但出现此错误:

错误合并工具代码比较

我的 .gitconfig 配置是这样的:

[core]
    autocrlf=false
[difftool "codecompare"]
cmd = 'C:\\Program Files\\Devart\\Code Compare\\codecompare.exe' -W \"$LOCAL\" \"$REMOTE\" 
renames = true

[diff]
tool = codecompare
guitool = codecompare

[mergetool "codecompare"]
cmd = 'C:\\Program Files\\Devart\\Code Compare\\codemerge.exe' -MF=\"$LOCAL\" -TF=\"$REMOTE\" -BF=\"$BASE\" -RF=\"$MERGED\" 
trustExitCode = true

[mergetool]
keepBackup = false

[merge]
tool = codecompare
guitool = codecompare

参数填充如下:

论据:

"-MF=./DBchanges/file change DB1.0_LOCAL_3972.sql" 
"-TF=./DBchanges/file change DB1.0_REMOTE_3972.sql" 
"-BF=./DBchanges/file change DB1.0_BASE_3972.sql" 
"-RF=DBchanges/file change DB1.0.sql"

有人知道可能是什么原因吗?

谢谢大家

4

1 回答 1

1

我找到了解决方案:

问题出在这一行:

[mergetool "codecompare"]
cmd = 'C:\\Program Files\\Devart\\Code Compare\\codemerge.exe' -MF=\"$LOCAL\" -TF=\"$REMOTE\" -BF=\"$BASE\" -RF=\"$MERGED\" 

我们需要更改空格 ( -MF \"$LOCAL\") 的符号“=”,因为引用的参数如下:

"-MF=./DBchanges/file change DB1.0_LOCAL_3972.sql"

并且必须像:

-MF "./DBchanges/file change DB1.0_LOCAL_3972.sql" 
于 2016-04-11T08:52:21.677 回答