git配置
配置文件内容如下:
[diff]
tool = kdiff3
[merge]
tool = kdiff3
[difftool "kdiff3"]
cmd = 'C:/Program Files/KDiff3/kdiff3.exe' "$LOCAL" "$REMOTE"
[mergetool "kdiff3"]
cmd = 'C:/Program Files/KDiff3/kdiff3.exe' "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"
trustExitCode = true
使用时,命令如下:
git difftool <file>
git mergetool <file>
图形界面设置
SourceTree
- 设置方法
菜单:Tools -> Options
- 使用方法
菜单:Actions -> External Diff (Ctrl+D)
SmartGit
- 设置方法
菜单: Edit -> Preferences
- 使用方法
菜单: Query -> Show Changes (F4)