git使用Beyond Compare作为diff和merge工具
git pull或merge产生冲突时需要手动解决冲突,使用BeyondCompare可以较方便地完成该项工作。WSL下git配置如下:
$ cat ~/.gitconfig
[i18n]
logoutputencoding = utf-8
[user]
email = chudongyu@corp.xxxx.com
name = chudongyu
[core]
editor = vim
autocrlf = input
[difftool "bc4"]
cmd = "\"/mnt/d/Program Files/Beyond Compare 4/BCompare.exe\" \"$LOCAL\" \"$REMOTE\""
[merge]
tool = bc4
[mergetool "bc4"]
cmd = "\"/mnt/d/Program Files/Beyond Compare 4/BCompare.exe\" \"$BASE\" \"$MERGED\""
git difftool
git mergetool
产生冲突后,使用git mergetool
,git会使用bc4逐个打开冲突文件让你解决。所有冲突文件处理后git merge --continue
或正常add后commit即可。