Why can't I use TortoiseMerge as my git merge tool on Windows?
If you have the latest git, run this command line once:
git config merge.tool tortoisemerge
Important: Do not add a .exe
extension to the command.
If that fails, or if you want to add a different merge tool that git doesn't know about, do this:
Open one of the following in an editor:
- 64-bit git:
C:\Program Files\Git\mingw64\share\git-gui\lib\mergetool.tcl
- 32-bit git:
C:\Program Files (x86)\Git\share\git-gui\lib\mergetool.tcl
Add something like this to mergetool.tcl:
tortoisemerge { set cmdline [list TortoiseMerge.exe -base:"$BASE" -mine:"$LOCAL" -theirs:"$REMOTE" -merged:"$MERGED"]}
Put the new tortoisemerge entry above this other code:
default { error_popup [mc "Unsupported merge tool '%s'" $tool] return}
Bonus example:
To use SourceGear diffmerge, add this to mergetool.tcl:
diffmerge { set cmdline [list "C:/Program Files (x86)/SourceGear/DiffMerge/DiffMerge.exe" --merge --result=$MERGED $LOCAL $BASE $REMOTE]}
Try this:
[merge]tool = tortoise[mergetool "tortoise"]cmd = "TortoiseMerge.exe" -base:"$BASE" -theirs:"$REMOTE" -mine:"$LOCAL" -merged:"$MERGED"
Source: http://programmersunlimited.wordpress.com/2010/07/01/getting-git-to-use-tortoisemerge/
For the case that I was working on, the mergetool was already set to tortoisemerge, but it could not find it.
Providing a fully qualified location worked in Windows:
git config --global mergetool.tortoisemerge.cmd "\"C:\\Program Files\\TortoiseGit\\bin\\TortoiseGitMerge.exe\" -base:\"$BASE\" -mine:\"$LOCAL\" -theirs:\"$REMOTE\" -merged:\"$MERGED\""