Why can't I use TortoiseMerge as a tool to merge git on Windows?

I'm trying to do my first Git merge ever (exciting!), But can't get Git Gui (0.13.GITGUI from Git 1.7.4.msysgit.0) to recognize TortoiseMerge (1.6.11.20210 x64) on Windows 7. On Based on the answer to a similar question, I made the following configuration changes:

$ git config --global merge.tool tortoisemerge $ git config --global mergetool.tortoisemerge.cmd 'TortoiseMerge.exe -base:"$BASE" -mine:"$LOCAL" -theirs:"$REMOTE" -merged:"$MERGED"' $ git config --global --list ...snip... merge.tool=tortoisemerge mergetool.tortoisemerge.cmd=TortoiseMerge.exe -base:"$BASE" -mine:"$LOCAL" -theirs:"$REMOTE" -merged:"$MERGED" $ 

Unfortunately, when I start Git Gui and try to โ€œstart the merge toolโ€, I get the Unsupported merge tool 'tortoisemerge' error message.

Can someone tell me what I did wrong? Here are the relevant sections of my ~/.gitconfig :

 [merge] tool = tortoisemerge [mergetool "tortoisemerge"] cmd = TortoiseMerge.exe -base:\"$BASE\" -mine:\"$LOCAL\" -theirs:\"$REMOTE\" -merged:\"$MERGED\" 

Update

TortoiseMerge works great with the above configuration when running git mergetool from the command line. It seems that only Git Gui has problems with this.: - /

+44
git user-interface windows mergetool tortoisemerge
Mar 04 2018-11-11T00:
source share
5 answers

If you have the latest git, run this command line once:

git config merge.tool tortoisemerge

Important: Do not add the .exe extension to the command.

If this fails, or if you want to add another merge tool that git doesn't know about, do the following:

Open one of the following in the 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 mergetool.tcl:

 tortoisemerge { set cmdline [list TortoiseMerge.exe -base:"$BASE" -mine:"$LOCAL" -theirs:"$REMOTE" -merged:"$MERGED"] } 

Put a new turtle entry above this other code:

 default { error_popup [mc "Unsupported merge tool '%s'" $tool] return } 

Bonus example:

To use diffgerge SourceGear, add this to mergetool.tcl:

 diffmerge { set cmdline [list "C:/Program Files (x86)/SourceGear/DiffMerge/DiffMerge.exe" --merge --result=$MERGED $LOCAL $BASE $REMOTE] } 
+54
Apr 13 '13 at 3:58
source share

Try the following:

 [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/

+17
Mar 04 2018-11-11T00:
source share

In the case I was working on, the merge was already set to tortoisemerge, but it could not find it.

Providing a fully qualified location running on Windows:

 git config --global mergetool.tortoisemerge.cmd "\"C:\\Program Files\\TortoiseGit\\bin\\TortoiseGitMerge.exe\" -base:\"$BASE\" -mine:\"$LOCAL\" -theirs:\"$REMOTE\" -merged:\"$MERGED\"" 
+4
Oct 31 '13 at 15:54
source share

Try entering TortoiseMerge.exe from the command line to see this on the way. If you donโ€™t add it using My Computer> Properties> Advanced> Environment Variables> System Variables: Path.

Then configure it from the command line using the following commands

 git config --replace --global diff.tool tortoisemerge git config --replace --global difftool.diffmerge.cmd "TortoiseMerge.exe -base:\"$BASE\" -theirs:\"$REMOTE\" -mine:\"$LOCAL\" -merged:\"$MERGED\"" git config --replace --global difftool.prompt false 

To use it from the command line, enter git difftool from your git difftool working directory.

It displays files one at a time, so you better still install TortoiseGit, which simplifies processing, even if for the diff part.

+2
Mar 25 2018-12-25T00:
source share

This problem appears in the latest git (I have git version 1.9.4.msysgit.1 ).

 C:\git\build>git mergetool This message is displayed because 'merge.tool' is not configured. See 'git mergetool --tool-help' or 'git help config' for more details. 'git mergetool' will now attempt to use one of the following tools: tortoisemerge emerge vimdiff C:\git\build>git config merge.tool tortoisemerge C:\git\build>git mergetool No files need merging 
+1
Apr 01 '15 at 0:10
source share



All Articles