WebStorm git difftool -d 立即关闭,无需等待用户 [英] WebStorm git difftool -d closes immediately without waiting for user
问题描述
运行 git difftool -d
在 Windows 上打开 WebStorm diff 工具,但内容一启动就消失了.
Running git difftool -d <commit> <commit>
on Windows opens the WebStorm diff tool but the contents disappear as soon as it starts.
尝试了 trustExitCode、提示和 bat 文件.
Tried trustExitCode, prompt and the 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 已经打开,因此 diff 传递到现有实例并且 diff 命令返回.一旦它返回,git 就会进行清理,内容就消失了.
This happens because JetBrains WebStorm is already open so the diff is passed off to the existing instance and the diff command returns. As soon as it returns, git does a cleanup and poof the contents are gone.
解决方案:
- 在差异之前关闭 WebStorm.仅在不使用 WebStorm 进行编辑时有用.
用 sleep 或
cmd//c "pause"
保持外壳.关闭 diff 窗口后,返回 shell 并按 Ctrl+c.或者以git difftool -d
.启动 difftool<提交>&
- Close WebStorm before diff. Only useful if not using WebStorm for editing.
Hold the shell with sleep or
cmd //c "pause"
. After closing the diff window, return to shell and press Ctrl+c. Or start the difftool asgit difftool -d <commit> <commit> &
.
cmd = \"C:/Users/
/AppData/Roaming/JetBrains/WebStorm 2018.1.2/bin/webstorm64.exe\" diff \"$LOCAL\" \"$REMOTE\&&&&&&&&&睡眠3600
Mac 上的类似问题:使用 IntelliJ 作为 git mergetool 总是一启动就退出
Similar issue on Mac: Using IntelliJ as git mergetool always exits as soon as soon as it starts
这篇关于WebStorm git difftool -d 立即关闭,无需等待用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!