Search code examples
webstormtortoisegittortoisegitmerge

Webstorm External Merge tool


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?


Solution

  • 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