Skip to content

Instantly share code, notes, and snippets.

@jfromaniello
Last active April 5, 2024 21:53
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save jfromaniello/9207698 to your computer and use it in GitHub Desktop.
Save jfromaniello/9207698 to your computer and use it in GitHub Desktop.
Integrate beyond compare 4 with git

Install command line tools:

then run this:

git config --global diff.tool bc3
git config --global difftool.bc3 trustExitCode true
git config --global merge.tool bc3
git config --global mergetool.bc3 trustExitCode true
ln -s /usr/local/bin/bcomp /usr/local/bin/bc3

now use git difftool and git mergetool.

SourceTree

For diff:

Visual Diff Tool: Other, Command: /usr/local/bin/bcomp, Arguments: $LOCAL $REMOTE

For merge:

Visual Diff Tool: Other, Command: /usr/local/bin/bcomp, Arguments: $LOCAL $REMOTE $BASE -mergeoutput=$MERGED

@sihuiDomain
Copy link

hi @jfromaniello
my bad, i did not reset merge

@neverhoodboy
Copy link

git config --global mergetool.bc3 trustExitCode true results in the following code in ~/.gitconfig

[mergetool]
    bc3 = trustExitCode

which looks weird. I was expecting something like:

[mergetool "bc3"]
    trustExitCode = true

Is git config --global mergetool.bc3 trustExitCode true the right command to go?

@compie
Copy link

compie commented Jun 15, 2016

These are the correct commands:

git config --global difftool.bc3.trustExitCode true
git config --global mergetool.bc3.trustExitCode true

Note: there must be a . (dot) between bc3 and trustExitCode.

@tjtaill
Copy link

tjtaill commented Jan 7, 2017

I really can't beyond compare 4 setup on mac followed these instructions and many others in the bc forums as well nothing works

@jfromaniello
Copy link
Author

This is my current ~/.gitconfig

[diff]
	tool = bc3
[difftool "bc3"]
	trustExitCode = true
[merge]
	tool = bc3
[mergetool "bc3"]
	trustExitCode = true

I followed the instructions here:
http://www.scootersoftware.com/support.php?zz=kb_vcs#gitlinux

@edwardbeckett
Copy link

I've had this working fine for a couple years ~ I'm on Windows but just change the path to your install on nix | macOs

~/.gitconfig

[merge]
	tool = bc4
[mergetool]
	prompt = false

[diff]
	tool = bc4
	stat = true
	guitool = bc4
[difftool]
	prompt = false
[difftool "bc4"]
    path = \"C:/Program Files/Beyond Compare 4/bcomp.exe\"
    cmd = \"C:/Program Files/Beyond Compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"
    trustExitCode = true
[mergetool "bc4"]
    path = \"C:/Program Files/Beyond Compare 4/bcomp.exe\"
    cmd =  \"C:/Program Files/Beyond Compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
    trustExitCode = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment