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


当前回答

为我解决这个问题的是在密钥文件上执行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.

其他回答

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

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

基本URL重写

Git提供了一种使用Git配置重写url的方法。只需发出以下命令:

git config --global url."https://".insteadOf git://

现在,就像变魔术一样,所有git命令都将执行git://到https://的替换

来源: 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 -T -p 443 git@ssh.github.com而不是ssh -T git@github.com

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

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

固定它。