将IntelliJ用作git mergetool总是在启动后立即退出 [英] Using IntelliJ as git mergetool always exits as soon as soon as it starts

查看:143
本文介绍了将IntelliJ用作git mergetool总是在启动后立即退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Mac上将IntelliJ配置为diff和mergetool,但是git启动了它,命令行总是立即返回,而不是等待diff完成,这意味着所执行的更改不会反映在磁盘上

I have configured IntelliJ as my diff and mergetool on my mac, but the git launches it, the command line always returns immediately, rather than waiting for the diff to be completed, which means that the changes enacted are not reflected on disk.

我的配置是:

[mergetool "intellij"]
    cmd = /Applications/IntelliJ\\ IDEA\\ 13\\ CE.app/Contents/MacOS/idea merge \
          $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") \
          $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") \
          $(cd $(dirname \"$BASE\") && pwd)/$(basename \"$BASE\") 
          $(cd $(dirname \"$MERGED\") && pwd)/$(basename \"$MERGED\")
    trustExitCode = true

我已经测试了没有git的情况下手动调用IntelliJ的情况,并且它也立即返回,所以我不认为这是由于git的调用引起的,而是IntelliJ命令行调用只是发送一条消息来打开现有窗口是否正在运行IntelliJ实例.是否可以选择强制IntelliJ不返回或产生新实例来使其工作?

I've testing calling IntelliJ by hand without git and it also returns immediately, so I don't think this is caused by git's invocation, rather that the IntelliJ command line invocation just sends a message to open the window to an existing running instance of IntelliJ.. Is there an option to force IntelliJ to not return or spawn a new instance to make this work?

推荐答案

没有办法.有三种解决方法:

There is no way to do it. There are three workarounds:

  1. 在使用difftool之前关闭现有应用程序.如果没有其他窗口打开,则mergetool将正常运行.

  1. Close existing application before using difftool. If there are no other windows open, mergetool will work correctly.

将IntelliJ的第二个实例与不同的缓存和配置主目录一起使用仔细审理二审许可.例如,如果您使用许可证服务器,则两个实例都将从服务器获取许可证.

Use second instance of IntelliJ with different caches and config home But be careful with licensing of second instance. If you use license server for example both instances will take a license from server.

在启动脚本中添加类似暂停"(在Windows上)的功能.因此,git将调用BAT文件(在Windows上),并且此BAT文件将调用IntelliJ,然后等待输入.完成所有需要的操作后,您应该返回控制台并手动按任意键.

Add something like pause (on Windows) to a startup script. So git will call BAT file (on Windows) and this BAT file will call IntelliJ and then wait for input. After you do all what you need, you should go back to console and press any key manually.

这篇关于将IntelliJ用作git mergetool总是在启动后立即退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆