我一直在尝试弄清楚如何在Windows(cygwin)上使用Git时通过命令行配置Beyond compare。根据Beyond compare的文档,他们要求您只需使用“路径”到bcomp.exe安装,并且应该一切正常。但是它不会自动选择“本地”,“基本”和“远程”参数。我正在使用Beyond Compare 3.0 PRO。
我一直在尝试弄清楚如何在Windows(cygwin)上使用Git时通过命令行配置Beyond compare。根据Beyond compare的文档,他们要求您只需使用“路径”到bcomp.exe安装,并且应该一切正常。但是它不会自动选择“本地”,“基本”和“远程”参数。我正在使用Beyond Compare 3.0 PRO。
我通过对git配置进行一些调整,找到了答案。 注意:我在记事本中编辑了全局git配置文件,并在完成后查看了我的配置。希望这能帮助某些人。
[diff]
tool = bc4
[difftool "bc4"]
cmd = "C:/program\\ files\\ \\(x86\\)/beyond\\ compare\\ 4/bcomp.exe $LOCAL $REMOTE"
[merge]
tool = bc4
[mergetool "bc4"]
cmd = "C:/Program\\ Files\\ \\(x86\\)/Beyond\\ Compare\\ 4/Bcomp.exe $LOCAL $REMOTE $BASE $MERGED"
trustExitCode = true
keepBackup = false
超越比较版本3。
对于Linux终端,请输入以下命令:
git config --global diff.tool bc3
git config --global difftool.prompt false
git config --global difftool.bc3 trustExitCode true
git config --global merge.tool bc3
git config --global mergetool.bc3 trustExitCode true
对于Windows系统,请执行以下操作(你需要告诉Git bcomp.exe的路径)
git config --global difftool.bc3.path "c:/program files (x86)/beyond compare 3/BCompare.exe"
git config --global mergetool.bc3.path "c:/program files (x86)/beyond compare 3/bcomp.exe"
[diff]
tool = bc
[difftool "bc"]
cmd = '"C:/Program Files/Beyond Compare 4/BComp.exe"' "$LOCAL" "$REMOTE"
[merge]
tool = bc
[mergetool "bc"]
cmd = '"C:/Program Files/Beyond Compare 4/BComp.exe"' "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
trustExitCode = true
keepBackup = false
跟进一下:您可以使用以下代码直接从命令行编辑配置文件。-它将启动您的命令行默认编辑器。
$ git config --global --edit
附注:上面的提示对我也起作用。我正在使用win7企业版。