我正在尝试使用 git 的新(从 git 1.7.11 开始)目录差异命令和 Beyond Compare 3 作为差异工具,但没有创建临时文件。
例如:
git difftool --dir-diff <branch1> <branch2>
Beyond Compare 打开一个目录比较,其中列出了正确的目录和更改的文件。
但是,当我单击任何文件时,出现以下错误:
Unable to load C:\Users\<username>\AppData\Local\Temp\git-difftool.yG8V5\left\<path to some file>: The system cannot find the path specified
所以,我检查一下 C:\Users\<username>\AppData\Local\Temp\git-difftool.yG8V5
是否目录存在,但不存在。
Beyond Compare 3 可以很好地用作非目录差异和 merge 的差异工具。
我正在使用适用于 Windows (msysgit) 1.8.0 的 git。
以下是相关的 .gitconfig 设置:
# External Visual Diff/Merge Tool
[diff]
tool = bc3
[difftool "bc3"]
path = "C:/Program Files (x86)/Beyond Compare 3/BComp.exe"
[merge]
tool = bc3
[mergetool "bc3"]
keepTemporaries = false
trustExitCode = true
keepBackup = false
path = "C:/Program Files (x86)/Beyond Compare 3/BComp.exe"
最佳答案
描述了一个解决方案 here .基本上,如果您修改 .gitconfig 以使用 BCompare.exe
而不是 BComp.exe
,则控制台 session 将保持打开状态,直到 Beyond Compare 窗口关闭。
修改你的 .gitconfig 设置为:
# External Visual Diff/Merge Tool
[diff]
tool = bc3
[difftool "bc3"]
path = "C:/Program Files (x86)/Beyond Compare 3/BCompare.exe"
关于git difftool --dir-diff 没有创建供 Beyond Compare 3 使用的临时文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13310995/