Provide Best Programming Tutorials

使用Beyond Compare作为git mergetool的默认对比工具 For Mac

第一步

点击下载下载Beyond Compare

第二步

image.png

第三步

Mac上需要在user目录下的.gitconfig文件中加入下面的配置:

或用终端打开.gitconfig文件在里面添加下面的配置, 终端指令 $git config --edit --global

[diff]
        tool = bcomp
[difftool "bcomp"]
        cmd = \"/usr/local/bin/bcomp\" \"$LOCAL\" \"$REMOTE\"
[difftool]
        prompt = false
[merge]
        tool = bcomp
[mergetool]
        prompt = false
[mergetool "bcomp"]
        cmd = \"/usr/local/bin/bcomp\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

第四步

如果项目有冲突执行指令:

git mergetool

Leave a Reply

Close Menu