我在代理下,我在相当长的一段时间内成功地推进。 现在我突然不能进入git了。 我已经设置了RSA密钥和代理,并仔细检查了它们,没有效果,git抛出了页面标题中显示的错误。


当前回答

刷新我的网络连接对我很有效。

此外,如果你使用移动热点-重新启动移动设备是解决方案在我的情况下。

其他回答

我也有同样的问题,但我发现的答案是不同的,认为有人可能会遇到这个问题,所以这是我的解决方案。

我必须为端口22、80、443和9418列出2个ip白名单:

192.30.252.0/22 185.199.108.0/22

如果这些IP不能工作,这可能是因为他们更新了,你可以在这个页面上找到最新的。

执行:

nc -v -z <git-repository> <port>

你的输出应该是这样的:

"Connection to <git-repository> <port> port [tcp/*] succeeded!"

如果你得到:

connect to <git-repository> <port> (tcp) failed: Connection timed out

您需要编辑~/。ssh / config文件。添加如下内容:

Host example.com
Port 1234

对我来说,问题来自ISP方面。Internet服务提供商未启用端口号。所以让他们在我的网络上启用端口号,它开始工作。 仅用于测试:连接到移动热点并输入ssh -T git@bitbucket.org或git pull。 如果可以,请您的ISP启用该端口。

在.ssh文件夹中 创建config文件

Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

我的电脑在连接到Github时无法连接22端口。我用bitbucket从来没有这个问题。如果你同时拥有GitHub和bitbucket

Host bitbucket.org
Hostname  altssh.bitbucket.org
Port  443


Host github.com
Hostname ssh.github.com
Port 443

ref

它基本上在443端口连接SSH,而不是22端口。