先安裝 Beyond Compare悔政,我 Mac 上用的是 Version 4.2.3 (build 22587)晚吞。
再配置 Beyond Compare 命令行工具:Beyond Compare -> Install Command Line Tools -> 填寫電腦密碼 -> Successfully installed command line tools. -> OK延旧。此時(shí)可以用 bcomp file1 file2 比較文件了谋国。
最后配置 git 對(duì)比工具:
// Use bc3 on the command line for both BC version 3 and 4
// Diff Confirm that "bcompare" can be launched from Terminal. Then in a console window enter:
$ git config --global diff.tool bc3
$ git config --global difftool.bc3.trustExitCode true
// To launch a diff using Beyond Compare, use the command "git difftool file.ext".
// Merge Confirm that "bcompare" can be launched from Terminal. Then enter the following:
git config --global merge.tool bc3
git config --global mergetool.bc3.trustExitCode true
// To launch a 3-way merge using Beyond Compare, use the command "git mergetool file.ext".
// option
// git config --global difftool.prompt false
快在終端里鍵入 git difftool
看看效果吧。