Setup .gitconfig for Beyond Compare use

How to set up .gitconfig for Beyond Compare

Beyond Compare is a diff tool that works very well on ubuntu, macOS and MSYS2 windows

To install:

Beyond Compare has a free trial Download, but it will require payment after the free trial expires, see Shop.

To use:

git diff     # use the standard text based diff
git vdiff    # use the visual diff i.e. the app

Ubuntu

To use it for git, create a ~/.gitconfig file with this content:

[user]
    name = %your_name%
    email = %your_email%

[pull]
    rebase = false
[push]
    autoSetupRemote = true

[diff]
    tool = bcompare
    submodule = diff
[difftool]
    prompt = false
[difftool "bcompare"]
    trustExitCode = true
    cmd = bcompare \"$LOCAL\" \"$REMOTE\"

[merge]
    tool = bcompare
[mergetool]
    prompt = false
[mergetool "bcompare"]
    trustExitCode = true
    cmd = bcompare \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

[alias]
    vdiff = !git difftool --dir-diff

Windows/MSYS2

The .gitconfig is the same in windows under MSYS2, except .exe extensions as needed. The rest is the same as above.

# see above

[diff]
        tool = bc
[difftool "bc"]
        path = c:/Program Files/Beyond Compare 5/bcomp.exe

[merge]
        tool = bc
[mergetool "bc"]
        path = c:/Program Files/Beyond Compare 5/bcomp.exe

[alias]
    vdiff = !git difftool --dir-diff

macOS

The .gitconfig under macOS is similar as well. The rest is the same as above.

[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\"

[alias]
    vdiff = !git difftool --dir-diff

- John Arrizza