Tuesday, May 10, 2016

How to Use Beyond Compare 4 as the default Mergetool and Difftool in Git

Beyond Compare 4 is a fantastic tool for comparing a variety of files and view differences in a folder tree. The feature list goes on and on. A tool so powerful as this can also be used as the default difftool and mergetool with Git Version Control system.

The following steps can be run to setup Git to work with Beyond Compare. These work on any operation system i.e., Windows, Linux etc., on Git version higher than 1.8. Ensure that bcomp.exe (Windows) or bcomp (Linux) are in the PATH, i.e., Git can access them from where difftool or mergetool commands are run.

  • Set Beyond Compare 4 as the default difftool

    ~]# git config --global diff.tool bc3
    ~]# git config --global difftool.bc3 trustExitCode true

  • Set Beyond Compare 4 as the default mergetool

    ~]# git config --global merge.tool bc3
    ~]# git config --global mergetool.bc3 trustExitCode true

Now you may run git difftool and git mergetool commands and the Beyond Compare will open up as expected.

0 comments:

Post a Comment