I'm trying to integrate WinMerge with Git as I've seen others done before on Windows 7 Ultimate.
I've followed the following steps, but an error continues to show up when I do a git mergetool which defaults to vimdiff.
Created a file called winmerge.sh in the root directory of git: C/Program Files (x86)/Git/ with: WinMergeU is the correct location.
#!/bin/sh
echo Launching WinMergeU.exe: $1 $2
"C:/Program Files (x86)/WinMerge/WinMergeU.exe"
git /e /u /dl "Base" /dr "Mine" "$1" "$2"
and used the following commands.
git config --global diff.tool winmerge
git config --global difftool.winmerge.cmd "winmerge.sh \"$LOCAL\" \"$REMOTE\""
git config --global difftool.prompt false
The error shows up as:
git config option merge.tool set to unknown tool: winmerge
Your path is incorrect, it should be
"/c/Program Files (x86)/WinMerge/WinMergeU.exe"
.You're running in a shell script environment, not native windows command prompt.
Here's mine (in
%userprofile%\.gitconfig
, or~/.gitconfig
on *nix), no wrapper (Win 7 Home Pro):Git 2.5+ (Q2 2015) will include Winmerge as a known
git mergetool
!If Winmerge is in your
%PATH%
, agit config merge.tool winmerge
is all you need to do!(It works for diff tool too:
git config diff.tool winmerge
)See commit 3e4f237 by David Aguilar (
davvid
), 20 May 2015.(Merged by Junio C Hamano --
gitster
-- in commit 324a9f4, 01 Jun 2015)Helped-by: Philip Oakley (
PhilipOakley
), Johannes Schindelin (dscho
), Sebastian Schuberth (sschuberth
), SZEDER Gábor (szeder
)All the config is now done for you directly in Git itself, with
mergetools/winmerge
:"$merge_tool_path" -u -e "$LOCAL" "$REMOTE"
"$merge_tool_path" -u -e -dl Local -dr Remote "$LOCAL" "$REMOTE" "$MERGED"