Tim Van Wassenhove

Passionate geek, interested in Technology. Proud father of two

12 Mar 2011

Using WinMerge as difftool on cygwin/git

Last couple of weeks i have been using Git on cygwin and i got very satisfying results out of it. One thing that i wanted to tweak was the ability to use WinMerge to compare files. Here is how i do it:

Here is my ~/.gitconfig:

[user]	  
name = Tim Van Wassenhove	  
email = git@timvw.be
[diff]
external = "~/bin/git-diff-wrapper.sh"

Here is my ~/bin/git-diff-wrapper.sh (it uses cygpath to translate the paths):

#!/bin/sh
"/cygdrive/c/Program Files/WinMerge/WinMergeU.EXE" /e /ub /dl other /dr local "\`cygpath -aw $1\`" "\`cygpath -aw $2\`" "\`cygpath -aw $5\`"

And now we are good to go 😉