Author: https://www.pexels.com/@maksgelatin

Setup Beyond Compare as GIT Mergetool on GNU/Linux

Aymen Furter

--

I like to use Beyond Compare (https://www.scootersoftware.com/) to resolve my git conflicts. Setting it up on Linux with git can be tricky. Let me guide you through the process.

  1. The first step is to verify that we have a recent version of git installed. This can be accomplished by executing “git version” command. Anything higher than version 1.8 is fine.
  2. Second step is to check if beyond compare was installed correctly. You can verify this by executing the bcompare command. I am using the Pro version.
  3. Next open the .gitconfig file in your home directory and append the following lines:
[diff]
tool = bc3
[difftool "bc3"]
trustExitCode = true
[merge]
tool = bc3
[mergetool "bc3"]
trustExitCode = true
cmd = /usr/bin/bcompare $LOCAL\n $REMOTE -savetarget=$MERGED
[mergetool]
keepBackup = false

Now Beyondcompare should startup if you run into a conflict. You can start the merge process using the git mergetool command.

--

--

Aymen Furter

I am a Cloud Solution Architect working for Microsoft. The views expressed on this site are mine alone and do not necessarily reflect the views of my employer.