Git difftool无法比较返回'致命:无法创建目录'':没有这样的文件或目录'

时间:2017-06-21 17:32:09

标签: git beyondcompare

偶尔在处理我的回购时,我收到此错误

fatal: cannot create directory at '': No such file or directory

当我尝试使用Beyond Compare 4

进行下面的差异时
'git difftool master head --dir-diff'

这是我的.gitconfig文件,其中删除了个人信息

[difftool "beyondcompare"]
        cmd = c:\\program files\\beyond compare 4\\bcompare.exe
[core]
        autocrlf = true
[difftool "bc4"]
        cmd = C:/Program\\ Files/Beyond\\ Compare\\ 4/BCompare.exe \"$LOCAL\" \"$REMOTE\"
[diff]
        tool = bc3
[difftool]
        prompt = false
[user]
        name = <REMOVED>
        email = <REMOVED>
[credential "<REMOVED>"]
        authority = <REMOVED>
[difftool "bc3"]
        path = c:/Program Files/Beyond Compare 4/bcomp.exe
[diff]
tool = bc4
[difftool "bc4"]
cmd = \"c:/program files/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"
[merge]
tool = bc4
[mergetool "bc4"]
cmd = \"c:/program files/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
trustExitCode = true

1 个答案:

答案 0 :(得分:0)

这与您定义的宏有关。 $ local指向/ old_file,而remote指向diff上下文中的b / new_file。

另外要记住的另一件事是git只会使用它为配置找到的最后一个值,除非它可以包含所有键,因此你没有使用其他值并且使配置文件混乱。 / p>