Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should I do when I get "TortoiseMerge cannot be used without a base"?

I use msysgit on my windows machine for Git. I have TortoiseGit installed mainly because I like TortoiseMerge and the log feature. Most of the time, when I use git mergetool to resolve merge conflicts, TortoiseMerge opens normally and lets me merge. Sometimes, I get "TortoiseMerge cannot be used without a base". I think that means that the file mentioned needs to be opened in a text editor to be manually merged. What's the most efficient way to respond to the "TortoiseMerge cannot be used without a base" error/message?

like image 268
Byron Sommardahl Avatar asked May 31 '13 21:05

Byron Sommardahl


2 Answers

Got this issue and kdiff3 didn't work either.

I finally used Tortoise. In you global .gitconfig

[merge]
    tool = tortoise
[mergetool "tortoise"]
    cmd = "/c/Program\\ Files/TortoiseSVN/bin/TortoiseMerge.exe" -base:"$BASE" -theirs:"$REMOTE" -mine:"$LOCAL" -merged:"$MERGED"

Above config use my old Tortoise SVN (not GIT). I suggest to new users to download TortoiseGit and use this config :

[mergetool "tortoise"]
    cmd = "/c/Program\\ Files/TortoiseGit/bin/TortoiseGitMerge.exe" -base:"$BASE" -theirs:"$REMOTE" -mine:"$LOCAL" -merged:"$MERGED"

After configs are updated, if you're using Git Bash, restart the terminal. Also you may have to call git config merge.tool tortoisemerge if not already done.

like image 135
alain.janinm Avatar answered Nov 15 '22 21:11

alain.janinm


This message happens whenever there's no base file (i.e. the file didn't exist in the tree at the last common ancestor between both branches). TortoiseMerge can't handle three-way merges where there isn't a base.

Your best bet would be to use a different tool. I personally use kdiff3, which handles this specific case without a problem, but there are others out there.

like image 38
Gaz M Avatar answered Nov 15 '22 22:11

Gaz M