Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Friday, April 08, 2011

Graphical diff tool for Git

I think I'm in love again. I had to resolve some hairy git conflicts, and the in-file conflict markers were not giving me insight into what was going on. It was basically showing me two big chunks of code that were pretty different.

I installed an open-source 3-way graphical diff tool called DiffMerge and configured git to use it, and it became obvious what to do (in this case, removing the green portion).

Check out the screenshot below, which shows ours on the left, the common ancestor in the middle, and theirs on the right. It's worth studying what the colors mean (in the DiffMerge preferences).

* AdminController.php.LOCAL.4607.php, AdminController.php.BASE.4607.php, AdminController.php.REMOTE.4607.php - SourceGear DiffMerge


  • You should check out p4merge, it's one of the client tools of Perforce, but you can use it standalone (and free) with git:

    git config --global merge.tool p4merge
    # and I recommend
    git config --global mergetool.keepBackup false

    By Blogger Benjol, at 4/11/2011 9:44 p.m.  

  • Ah - interesting. Thanks Benjol!

    By Blogger Jonathan, at 7/21/2011 7:31 p.m.  

Post a Comment

<< Home