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


当前回答

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

其他回答

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

主要原因是公司最近安装的代理发生了变化,阻止了公司域以外的其他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获取来验证

执行:

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

如果您在windows中,移动到您存储ssh密钥的目录,然后再试一次,这对我有用。