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


当前回答

在.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

其他回答

建议检查网络连接或重新连接。

好试试这个ssh -T -p 443 git@ssh.github.com而不是ssh -T git@github.com

在我的情况下,这个问题是由我前一天在路由器上更改的设置引起的。 所以在我的路由器上,我只需要将隔离设置恢复为禁用,它已经解决了我的问题。

原因可能是防火墙修改,因为您处于网络中。(在这种情况下,他们可能会故意封锁一些端口) 再次确认这是否是原因…做

ssh -T git@github.com

这应该会超时。 如果是这种情况,使用http协议而不是ssh 只需将配置文件中的url更改为http。 方法如下:-

git config --local -e

变更分录

 url = git@github.com:username/repo.git

to

url = https://github.com/username/repo.git

我有这个问题2个小时,结果是从https中删除“s”,只需做:

git克隆-b <branchName> http:<projecturl>

固定它。