WebStorm git difftool -d 立即关闭而不等待用户

WebStorm git difftool -d closes immediately without waiting for user

运行 git difftool -d <commit> <commit> on Windows 打开 WebStorm diff 工具,但内容一启动就消失了。

尝试了 trustExitCode、提示和 bat file

[diff]
        tool = webstorm
[difftool "webstorm"]
        cmd = \"C:/Users/<me>/AppData/Roaming/JetBrains/WebStorm 2018.1.2/bin/webstorm64.exe\" diff \"$LOCAL\" \"$REMOTE\"

发生这种情况是因为 JetBrains WebStorm 已经打开,因此差异被传递给现有实例和差异命令 returns。一旦它 returns,git 进行清理并且内容消失了。

解决方案:

  1. 比较之前关闭 WebStorm。只有在不使用 WebStorm 进行编辑时才有用。
  2. 抱着shell睡觉或cmd //c "pause"。关闭 diff window、return 到 shell 后按 Ctrl+c。或者以 git difftool -d <commit> <commit> &.

    启动 difftool
    • cmd = \"C:/Users/<me>/AppData/Roaming/JetBrains/WebStorm 2018.1.2/bin/webstorm64.exe\" diff \"$LOCAL\" \"$REMOTE\" && sleep 3600

Mac 上的类似问题:Using IntelliJ as git mergetool always exits as soon as soon as it starts