Wednesday, November 12, 2014

I spend a good part of my work time diffing code, and I'm a big fan of DiffMerge. It's cross-platform, and can handle scary merge conflicts well. It works particularly nicely on wide screens, like the massive LG UltraWide that Matterport gives to engineers (side note: this monitor is so large that I have to refocus my eyes at a different distance to read text on the edges of the screen. It was strange for a couple of days, and now I'm a big fan and will probably never go back. Like having a big screen on your phone).


To set this up, I have the following global git config:

[alias]
        d = difftool
[diff]
        tool = diffmerge
[difftool "diffmerge"]
        cmd = \"/usr/bin/diffmerge\" --nosplash \"$LOCAL\" \"$REMOTE\" 2>/dev/null
        prompt = false
[merge]
        tool = diffmerge
[mergetool "diffmerge"]
        cmd = \"/usr/bin/diffmerge\" --nosplash --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
        trustExitCode = true
        keepBackup = false

Setting it up as a separate difftool is nice because I have flip between simple text diff and UI diff easily using an alias. So if I want a quick text view, I use
$ git diff master
If I want DiffMerge UI, I use the alias:
$ git d master

No comments:

Post a Comment