Git 罢工了?git向gitHub push失败

2018-06-29  本文已影响0人  tobrainto

现象

使用 IntelliJ IDEA、WebStorm、PyCharm等JetBrains系列IDE在向gitHub提交代码时提示push failed...

一脸懵逼

控制台的详细信息如下:

java.io.IOException: There was a problem while connecting to github.com:22
    at com.trilead.ssh2.Connection.connect(Connection.java:791)
    at com.trilead.ssh2.Connection.connect(Connection.java:577)
    at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:171)
    at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:137)
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
    at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:92)
    at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:230)
    at com.trilead.ssh2.Connection.connect(Connection.java:743)
    ... 3 more
Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
    at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:413)
    at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:754)
    at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:469)
    at java.lang.Thread.run(Thread.java:745)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
这个是低版本ide的bug,在高版本中已经修复,可以通过升级ide的方式解决这个问题

结果方案

在不升级ide的情况下可以通过在ided的设置(setting)窗口,找到git,将ssh executable设置项由Built-in更改为Native即可

变更后重新push即可

上一篇下一篇

猜你喜欢

热点阅读