Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can TortoiseMerge be used as a difftool with Windows Git Bash?

I'm just starting to work with Git. I would like to use TortoiseMerge as the difftool and mergetool.

In my $HOME/.gitconfig I have the following sections. I've removed the user and color sections for this question.

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

If I type tortoisemerge at the Git Bash prompt it loads. It is known to be on the path. But if I type the command I get the following error.

Rich:mygittest (master *) $ git difftool error: 'tortoisemerge' can only be used to resolve merges merge tool candidates: kompare emerge vimdiff No known merge resolution program available. external diff died, stopping at readme.txt. Rich:mygittest (master *) $  

What am I not understanding to make this work? Tortoisemerge is installed with TortoiseSVN.

like image 395
Rich Shealer Avatar asked May 11 '13 03:05

Rich Shealer


People also ask

How do I use the git Difftool command?

Specify a custom command for viewing diffs. git-difftool ignores the configured defaults and runs $command $LOCAL $REMOTE when this option is specified. Additionally, $BASE is set in the environment. When git-difftool is invoked with the -g or --gui option the default diff tool will be read from the configured diff.

How do I run git Difftool?

Usage. Run Git Difftool: Diff File from the Command Palette or use ⌥⌃D to diff the currently open file. Run Git Difftool: Diff Project from the Command Palette or use ⌃⇧D to diff the whole project.

What is mergetool in git?

Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge. If one or more <file> parameters are given, the merge tool program will be run to resolve differences on each file (skipping those without conflicts).


1 Answers

The following settings work fine for me. However, I am using TortoiseGit not TortoiseSVN. Notice the difference in the parameters for diff.

[diff]   tool = tortoisediff [difftool]   prompt = false [merge]   tool = tortoisemerge [mergetool]   prompt = false   keepBackup = false [difftool "tortoisediff"]   cmd = \""c:/Program Files/TortoiseGIT/bin/TortoiseGitMerge.exe"\" -mine "$REMOTE" -base "$LOCAL" [mergetool "tortoisemerge"]   cmd = \""c:/Program Files/TortoiseGIT/bin/TortoiseGitMerge.exe"\" -base "$BASE" -theirs "$REMOTE" -mine "$LOCAL" -merged "$MERGED" 
like image 115
Klas Mellbourn Avatar answered Oct 12 '22 02:10

Klas Mellbourn