Webstorm External Merge tool

292 views Asked by At

I'm trying to use an external merge tool (Tortoise Git) whitin Webstorm, but I encountered a problem. I can figure out how to replace the following placeholders in the "Parameters" input: $LOCAL, $REMOTE, $BASE and $MERGED.

enter image description here

As you can see I have %1 %2 %3 %4 which I must replace somehow. I've tryed with
$LOCAL $REMOTE $BASE $MERGED
but it didn't work. Can anybody help?

EDIT
The next problem is that when I encounter a conflict, TortoiseGit doesn't seems to find the files needed so I can process the merge. enter image description here

Here I have a conflict with index.html and I press "Merge".

enter image description here

Here TorgoiseGit ask me for the files.

So here I'm asking, how to configure WebStorm so TortoiseGit find these files automatically?

2

There are 2 answers

0
lena On BEST ANSWER

problem is caused by incorrect options escaping in WebStorm (IDEA-156227). I can suggest the following workaround:

  • create a new .bat file (C:\tortoise_launcher.bat, for example) with the following content:

start "" "C:\Program Files\TortoiseGit\bin\TortoiseGitMerge.exe" -base:%1 -mine:%2 -theirs:%3 -merged:%4

  • change Settings | Tools | Diff | External Diff Tools as follows:
Path to executable: cmd.exe
Parameters: /C C:\tortoise_launcher.bat %3 %1 %2 %4

This configuration works fine for me

2
Yue Lin Ho On

The Parameters may be:

/theirs:"%1" /mine:"%2" /base:"%3" /merged:"%4" /theirsname:"Local changes" /minename:"Server content" /basename:"BASE" /mergedname:"output"

(cf. TortoiseGitMerge Command Line Switches)

This is my testing:

TortoiseGitMerge.exe /theirs:"D:\left.txt" /mine:"D:\right.txt" /base:"D:\base.txt" /merged:"D:\output.txt" /theirsname:"Local changes" /minename:"Server content" /basename:"BASE" /mergedname:"output"

Something like this:

enter image description here


Add this reg will allow you to see the actual command line:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\TortoiseGitMerge]
"Debug"=dword:00000001

Perhaps help to figure something out. It will show a message box, something like this:

enter image description here