git - 推/pull 到 Github 在 Android Studio 和 IntelliJ 中被破坏

标签 git android-studio github intellij-idea ssh

我设置了 SSH 以从 Android Studio (3.0.1 - Build #AI-171.4443003) 和 IntelliJ(2017.3.4 - Build 173.4548.28),直到昨天(2018 年 2 月 22 日)一切正常。

今天(2018 年 2 月 23 日)突然间,当我尝试在 IntelliJ 或 Android Studio 中向/从 Github 推送或 pull 任何内容时,它失败了,我在“版本控制控制台”中收到此消息:

16:41:14.159: [onebusaway-android] git -c core.quotepath=false pull --progress --no-stat -v --progress upstream master
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:172)
        at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:138)
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.

这在两台不同的机器上同时发生,一台装有 Windows 7 企业版,另一台装有 Windows 10。

为什么这突然停止工作,我该如何解决?

最佳答案

IntelliJ 在 2018 年 2 月 23 日 中遇到了 github push, pull 问题。 原因是github不再支持IntelliJ中Built-in SSH的弱密码。

解决方案很简单,无需升级IntelliJ。

[IntelliJ - File - Settings - Version Controll - Git] 

You can change 'SSH executable' from 'Build-in' to 'Native'.

enter image description here

由于“Native”使用 git.exe,所以没有问题,因为大多数 git 客户端已经应用了最新的加密技术。 如果您使用的是旧版 git 客户端,请更新!

https://git-scm.com/download

ps) IntelliJ、PhpStorm、Android Studio 都有同样的问题,可以用同样的方法解决。

背景)Sean Barbeau 的回答。

关于git - 推/pull 到 Github 在 Android Studio 和 IntelliJ 中被破坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48956787/

相关文章:

git - 无法运行 git gc ..有什么解决办法吗?

java - 在 Eclipse 中使用 Git 会导致很多错误

Android Studio > 创建新项目 > Google Play 服务 Activity : What is this?

android - 无法创建调试桥 : Unable to start adb server: Unable to detect adb version, adb 输出:/sdk/platform-tools/adb:

r - 在 github 存储库中搜索定义给定函数的文件

linux - 使用 NeoBundle 时跨 mac 和 Ubuntu 服务器同步 vim 设置

git - 查看谁删除了 git 标签

java - 将 Kotlin 转换为 Java

github - Markdown 中的上标(Github 风格)?

eclipse - 如何使 Mylyn GitHub Connector for Eclipse 运行经过身份验证的请求?