可执行文件diff_ext,放置在/usr/local/bin下 #!/bin/bash $(which bcompare) $2 $5 | cat 然后运行 git config --global diff.external /usr/local/bin/diff_ext