1、Mac下载并安装kaleidoscope和ksdiff(下载地址),确保命令行中可以运行ksdiff
命令
2、修改GIT配置文件~/.gitconfig
,加入下面内容
[diff]
tool = Kaleidoscope
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
[merge]
tool = Kaleidoscope
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output "$MERGED" --base "$BASE" -- "$LOCAL" --snapshot "$REMOTE" --snapshot
trustExitCode = true
[mergetool]
prompt = false
3、命令行中运行git difftool
或git mergetool
(git difftool用于与git diff相同)将使用kaleidoscope打开对比的文件