Is there a way to use Winmerge inside of git to do Diffs?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update June 2015, 6 years later:
As detailed in “git mergetool winmerge“, a simple
git config diff.tool winmergewill be enough.Git 2.5+ (Q2, 2015) is now aware of Winmerge as a diff or merge tool!
Original answer (2009-2012)
(msysgit, 1.6.5, DOS session)
The first part (using winmerge) is described in “How do I view ‘git diff’ output with visual diff program?“
With
winmerge.shstored in a directory part of yourPATH:(see WinMerge Command-line options)
will now launch WinMerge.
If you want
git diffto launch WinMerge, just set:But the real added value comes from the ability to use that same diff tool to present all differences in one batch instead of presenting them sequentially, forcing you to close the diff tool windows one file at a time.
Update June 2012 (2-and-a-half years later):
Comparing directories instead of file-by-file will be available soon:
See [ANNOUNCE] Git 1.7.11.rc1:
See “Patch
difftool: teachdifftoolto handle directory diffs“, and the answer “Directory comparison of Git branches” for more details.Original difftool by directories script (December 2009)
As Seba Illingworth mentions in his answer, a script git-diffall.sh (also put in the path) can do just that:
But that only works by opening n windows for n files (if you try to use the
-soption of WinMerge, it will not work because of the temp files being deleted by the difftool too early)That is why I like the approach of GitDiff.bat – power-diffing with GI, which allows you to review the list of files with a difference, before selecting one to examine its internal differences.
I have tweaked it to use only DOS commands
It is not robust enough to handle files with same names in different directories, but it gives you a general idea of what is possible:
Here only one WinMerge will open up, with the list of files having internal differences. You can click on the ones you want to examines, then a simple ESC will close the all
WinMerge-diffsession.