First you need to put some scripts in the path that serve as wrapper for invoking DiffMerge and WinMerge.
All four scripts rely on
githelperfunction.sh to properly convert the path and set variables.
The scripts above take into account:
- Conversion of cygwin paths to Windows path
- Handle filenames with whitespace
- Handle properly non-existing files. Sometimes a file doesn’t exist in one of the branches you are comparing and then git will provide
/dev/nullas filename for that one. These scripts take care of converting that to a proper empty file in Windows.
- DiffMerge: Set the window title in DiffMerge to the filename. And set labels for each file window to
- WinMerge: Set the file labels to
After storing those script and make them accessible from your
$PATH then you need to tell
git how to use them.
You can use the following commands to tell
git about this wrappers:
1 2 3 4 5 6 7 8 9 10
And then you can invoke
git difftool and
git mergetool using
-t <TOOL> to indicate which one you want to use:
1 2 3 4
if you want to make any of those tools the default you can use
git config to do so:
Hope this helps