Setting up Beyond Compare as difftool and mergetool in Git

Set up Becond Compare as difftool and mergetool in Git. Last updated: 2018-12-18

Environment: Windows, Git v2.13.2

You can use git commands or directly edit global git config file to configure Beyond Compare as difftool and mergetool.

Method 1 : use git commands

# Config Beyond Compare 4 as difftool

$ git config --global diff.tool bc4
$ git config --global difftool.prompt false
# Note: set parameters for Beyond Compare tool
$ git config --global difftool.bc4.cmd '"C:\Program Files\Beyond Compare 4\BCompare.exe" "$LOCAL" "$REMOTE"' 

# Config Becond Compare 4 as mergetool

$ git config --global merge.tool = bc4
$ git config --global mergetool.prompt false
$ git config --global mergetool.bc4.path 'C:\Program Files\Beyond Compare 4\BCompare.exe'

Method 2 : directly edit global git config file

Edit git global git file .gitconfig in your home directory and add below contents:

[diff]
    tool = bc4
[difftool]
    prompt = false
[difftool "bc4"]
    cmd = "\"C:\\Program Files\\Beyond Compare 4\\BCompare.exe\" \"$LOCAL\" \"$REMOTE\""
[merge]
    tool = bc4
[mergetool]
    prompt = false
[mergetool "bc4"]
    path = C:\\Program Files\\Beyond Compare 4\\BCompare.exe

Leave a Reply