Git difftool 与超越比较返回'fatal: cannot create directory at : No such file or directory'



偶尔在处理我的存储库时,我会收到此错误

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

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

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

相关内容

最新更新