无法连接到 github,但其他 git 存储库、bitbucket 和 ssh 可以正常工作

Cannot connect to github but other git repos, bitbucket and ssh do work fine

当我尝试克隆 github 存储库时,我得到

Couldn't agree a key exchange algorithm (available: curve25519-sha256@libssh.org,ecdh-sh
a2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521) 

如果我从私有存储库或我的 bitbucket 帐户尝试 git clone,它工作正常。

我在 windows7 64。我使用 pageant 作为 ssh 代理。我在 GIT_SSH 环境变量中尝试了 TortoisePlink.exe 和 plink.exe(这个 https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)。

在我格式化并重建我的电脑之前,我对这个配置和这个 ssh 密钥没有任何问题。

我已经尝试在我的 github 帐户中删除并重新添加密钥,我已经尝试使用 rsa 1024、rsa 4096 和 ed25519 密钥。

我是 运行 git windows bash。我也尝试过使用 phpstorm UI,结果相同。

如果我尝试使用 TortoisePlink.exe,就会发生这种情况(另外,我会收到一个带有上述错误的弹出窗口 window):

$ git clone git@github.com:foothing/laravel-gdpr-consent.git
Cloning into 'laravel-gdpr-consent'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

如果我尝试使用 plink.exe,就会发生这种情况:

$ git clone git@github.com:foothing/laravel-gdpr-consent.git
Cloning into 'laravel-gdpr-consent'...
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa xx:xx:xx
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)

我按了 y 但没有任何反应(我相信 git 和 plink 之间的输入处理发生了一些奇怪的事情)

如果我尝试通过 ssh 连接到 github,我会得到以下信息

$ ssh git@github.com
key_load_public: invalid format
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
Enter passphrase for key '/foo/bar/.ssh/id_rsa':
PTY allocation request failed on channel 0
Hi brazorf! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

Git版本:

$ git --version
git version 2.16.2.windows.1

否 ide为什么这个问题被否决了。

我就是这样解决这个问题的:

此处有更多详细信息https://github.com/desktop/desktop/issues/4105