Is there a way to use Winmerge inside of git to do Diffs?
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
Update June 2015, 6 years later:
As detailed in "git mergetool winmerge", a simple
git config diff.tool winmerge
will 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.sh
stored in a directory part of yourPATH
:(see WinMerge Command-line options)
will now launch WinMerge.
If you want
git diff
to 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
: teachdifftool
to 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
-s
option 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-diff
session.I have a script that will set the Diff and Merge tools in the Git config with the proper parameters that doesn't require a separate .sh file to exist. It seems to be working fine for me.
Note - the entire .cmd portion is quoted so that the parameters will be listed in the .gitconfig properly