Skip to content

Instantly share code, notes, and snippets.

@hqingyi
Last active December 9, 2015 06:59
Show Gist options
  • Save hqingyi/92f72e81d276d7808457 to your computer and use it in GitHub Desktop.
Save hqingyi/92f72e81d276d7808457 to your computer and use it in GitHub Desktop.
BeyondCompare as git mergetool/difftool

Use Beyond Compare as git mergetool/difftool

准备BeyondCompare

打开BeyondCompare安装好Command Line Utils

  • /usr/local/bin/bcomp
  • /usr/local/bin/bcompare

Git版本>2.3,直接配置bc3即可

git config --global diff.tool bc3
git config --global merge.tool bc3
git config --global mergetool.bc3 trustExitCode true

Git旧版本,配置.gitconfig添加自定义工具

[diff]
  tool = bcomp
[difftool]
  prompt = false
[difftool "bcomp"]
  trustExitCode = true
  cmd = "/usr/local/bin/bcomp" \"$LOCAL\" \"$REMOTE\"
[merge]
  tool = bcomp
[mergetool]
  prompt = false
[mergetool "bcomp"]
  trustExitCode = true
  cmd = "/usr/local/bin/bcomp" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment