在Windows上运行git difftool -d <commit> <commit>
会打开WebStorm差异工具,但是内容一启动就会消失。
[diff]
tool = webstorm
[difftool "webstorm"]
cmd = \"C:/Users/<me>/AppData/Roaming/JetBrains/WebStorm 2018.1.2/bin/webstorm64.exe\" diff \"$LOCAL\" \"$REMOTE\"
答案 0 :(得分:0)
发生这种情况是因为JetBrains WebStorm已经打开,因此diff被传递到现有实例,并且diff命令返回。一旦返回,git就会进行清理,并且所有内容都将消失。
解决方案:
使用睡眠或cmd //c "pause"
保持外壳。关闭diff窗口后,返回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