0

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?

MrTux
  • 32,350
  • 30
  • 109
  • 146
Marin Takanov
  • 1,079
  • 3
  • 19
  • 36
  • What do you mean by "I **must** replace somehow" ? As far as I'm aware the parameters meant to be `%1`, `%2`, `%3` and `%4` and not `$LOCAL` etc – LazyOne Mar 02 '16 at 13:16
  • 1
    %1 %2 %3 %4 it's not working. I'm wondering should I rearange the order or what? – Marin Takanov Mar 02 '16 at 13:30
  • Well .. it should be in order and using the syntax that Tortoise Git accepts. https://tortoisegit.org/docs/tortoisegitmerge/tme-automation.html (check command line parameters of actual program anyway) . Based on that it should be something like `/mine:"%1" /theirs:"%2" ...` – LazyOne Mar 02 '16 at 13:51

2 Answers2

1

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

lena
  • 90,154
  • 11
  • 145
  • 150
0

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

Yue Lin Ho
  • 2,945
  • 26
  • 36