Why doesn't tortoisemerge work as my mergetool

2019-03-16 05:37发布

问题:

I have TortoiseGit installed, and in the past it's used tortoisemerge as my mergetool seamlessly. But since I upgraded TortoiseGit to 1.8.x, my mergetool is no longer working:

c:\Code\whatever> git mergetool
merge tool candidates: tortoisemerge emerge vimdiff
No known merge resolution program available.

This used to work, so why is it broken now?

回答1:

According to this post, in version 1.8 TortoiseGit renamed tortoisemerge.exe to tortoisegitmerge.exe because the old version could not handle spaces in file names so well.

According to this blog post, you'll need to enter the following commands:

git config --global merge.tool tortoisemerge 
git config --global mergetool.tortoisemerge.cmd '"C:/Program Files/TortoiseGit/bin/TortoiseGitMerge.exe" -base:"$BASE" -theirs:"$REMOTE" -mine:"$LOCAL" -merged:"$MERGED"'

However, that didn't work for me so I added the following to my .gitconfig (which just changes the path to TortoiseGitMerge.exe:

[merge]
    tool = tortoisemerge
[mergetool "tortoisemerge"]
    path = C:\\Program Files\\TortoiseGit\\bin\\tortoisegitmerge.exe