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


当前回答

主要原因是公司最近安装的代理发生了变化,阻止了公司域以外的其他ssh连接。

我可以通过以下步骤成功连接:

仔细检查,这个问题是我所假设的 ssh -T git@github.com

它应该在一个超时中结束。

编辑本地远程URL

SSH配置——local -e

url = git@github。com: asheeshjanghu / Journal git。

to

url = https://github.com/asheeshjanghu/Journal.git

重要的一点是,在url中,你必须在2个地方改变。

从git@到https://,从github:username到github/username

最后通过git获取来验证

其他回答

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

上面的答案为我提供了解决这个问题所需的信息。在我的例子中,url错误地以ssh:///开头

要检查git配置中的url是否正确,请打开git配置文件:-

git config --local -e

检查url条目。它在开始时不应该有ssh:///。

不正确的条目:

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

正确的条目:

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

如果您的url是正确的,那么下一步将是尝试上面建议将协议更改为http的答案。

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

重启电脑帮我解决了这个问题。 Git版本:2.27.0.windows.1 操作系统版本:Windows 10

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

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

固定它。