Using WinMerge with git on Windows 7
November 28th, 2009
No comments
Though git is not my primary source code management tool, I use it whenever I work on complex code that I don’t want to commit yet. Or just to keep track of my local scripts.
And using “git difftool”, it is pretty simple to use third party tools like WinMerge for graphical diffs:
- Create a wrapper script (e.g.
git-diff-wrapper.sh) and put it anywhere in your Windows path (%PATH%):
#!/bin/sh
"C:/Program Files/WinMerge/WinMergeU.exe" -e -ub "$1" "$2" | cat - Update your .gitconfig to run this script whenever “git difftool” is invoked:
# … more config …
[diff]
tool = winmerge
[difftool "winmerge"]
cmd = git-diff-wrapper.sh "$LOCAL" "$REMOTE"
# … more config …
That’s it, no restart required