git使用beyond compare3作为比较工具
1,C:\Program Files\Git\etc\gitconfig里添加以下内容:
[alias]
dt = difftool
mt = mergetool
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
cmd = "c:/program files (x86)/beyond compare 3/BCompare.exe" "$LOCAL" "$REMOTE"
[merge]
tool = bc3
[mergetool]
prompt = false
keepBackup = false
[mergetool "bc3"]
cmd = "c:/program files (x86)/beyond compare 3/BCompare.exe" "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
trustExitCode = true
2,可以使用命令行 git dt "filename" 来比较当前文件的修改点了。
3,如果使用git-gui工具,可以在Tools->add添加该命令,name可以随便起,这里命名为compare, Command里填写 git dt $FILENAME (可以勾选dont show the command output window 和 Add Globally),之后就可以在Tools下有一个compare的命令了,选中某个文件后点击该命令会打开比较工具。
参考资料:
1,https://p3terx.com/archives/configure-beyond-compare-as-a-git-comparison-tool-under-windows.html
2,https://gist.github.com/dahlbyk/1950155