且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ssh:连接到主机 github.com 端口 22:连接超时

更新时间:2022-06-22 09:42:10

原因可能是你在网络下修改了防火墙.(在这种情况下,他们可能会故意阻止某些端口)
要仔细检查这是否是原因......做

The reason could be the firewall modification as you are under a network.(In which case they may deliberately block some ports)
To double check if this is the reason ... do

ssh -T git@github.com

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

this should timeout. If that's the case use http protocol instead of ssh this way
just change your url in the config file to http.
Here is how :-

git config --local -e

更改条目

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

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