git difftool和mergetool图形化
1.当然是先安装Beyond Compare3 (此处省略安装步骤,自行百度)
2.设置difftool
git config --global diff.tool bc3
git config --global difftool.bc3.path "/usr/bin/bcompare
git config --global difftool.prompt false
3.设置mergetool
git config --global merge.tool bc3
git config --global mergetool.bc3.path "/usr/bin/bcompare"
git config --global mergetool.bc3.trustExitCode true
____________________________________________________________________________________________
Windows git difftool和mergetool图形化
1.当然是先安装Beyond Compare3 (此处省略安装步骤,自行百度)
2.设置difftool
git config --global diff.tool bc3
git config --global difftool.bc3.cmd "\"c:/program files/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\""
git config --global difftool.prompt false
3.设置mergetool
git config --global merge.tool bc3
git config --global mergetool.bc3.cmd "\"c:/program files/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
git config --global mergetool.bc3.trustExitCode true
____________________________________________________________________________________________
使用时:
diff时,用git difftool <file_name>来查看就会直接弹出bcompare.
merge时,要先用git merge <branch_name> 来merge一下,然后如果提示merge有冲突,才用git mergetool来调用bcompare来merge
---------------------