Ubuntu Git配置Beyond Compare为比较工具

Ubuntu 20.04  配置Git比较工具

安装好Beyond Compare4 和Git后,运行下面git config 命令:

git config --global diff.tool bc3
git config --global difftool.prompt false
git config --global difftool.bc3.cmd '/usr/bin/bcompare "$LOCAL" "$REMOTE"'
git config --global merge.tool bc3
git config --global mergetool.prompt false
git config --global mergetool.bc3.cmd '/usr/bin/bcompare "$LOCAL" "$REMOTE" "-savetarget=$MERGED"'
git config --global mergetool.bc3.trustexitcode true
git config --global alias.d difftool
git config --global alias.m mergetool

用法:

1. 比较单个文件:

git difftool filename

或 git d filename

2. 多个文件一起比较(比较文件夹)
git difftool --dir-diff --no-symlinks

原文地址:https://www.cnblogs.com/xuewangkai/p/14184207.html