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


当前回答

这个答案是基于@zundi对主要问题的评论(功劳应该归谁,谢谢zundi):

在您的移动设备上创建热点并连接热点 git推 关闭您的移动设备上的热点并重新连接到原来的网络 Git推送继续工作

我不知道为什么临时连接到一个热点神奇地“启动”原来的网络连接。

其他回答

将repo url从ssh更改为https对我来说没有多大意义。因为我更喜欢ssh而不是https,因为我不想放弃一些额外的好处。以上答案都很好,也很准确。如果你在GitLab遇到这个问题,请去他们的官方文档页面,并像那样修改你的配置文件。

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

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

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

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

192.30.252.0/22 185.199.108.0/22

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

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

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

固定它。

为我解决这个问题的是在密钥文件上执行ssh-add。

ssh-add C:/Path/To/Key.pem

C: / Users / User / .ssh / config:

Host sshapp
    Hostname ssh.github.com
    IdentityFile C:/Path/To/Key.pem
    Port 443

然后克隆使用:

>git clone git@sshapp:<git_user>/app.git
Cloning into 'app'...
The authenticity of host '[ssh.github.com]:443 ([140.82.121.35]:443)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6T.....vCOqU.