git报错处理:ssh:connect to host github.com port 22: Connection timed out

一、背景

git 在上传、下载 文件的时候,报错。

报错信息:

ssh:connect to host github.com port 22: Connection timed out

提示这个域名github.com port 的22 端口,链接超时。

我直接访问github.com 这个域名是可以访问的,ping 也是可以ping通的。

使用telnet 链接github.com 的22 端口,报超时错误。

telnet xx.xx.xx 22

所以,问题就在这个22端口上。

二、解决办法

我原来使用的ssh链接方式,会报这个错误。

改成http ,就可以了。

在github上,把ssh 改成 http 。

 上传 和下载 也是用http的方式。

git clone http://xxx.xxx.com/xxxxx.git

猜你喜欢

转载自blog.csdn.net/qq_39208536/article/details/130318102