用git 拉取代码时, 偶尔会出现下面的错误:

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

出现这个错误的原因是 22 端口被防火墙屏蔽了, 换一个端口即可,如443端口。
操作方法:

 vim ~/.ssh/config

添加如下内容:

Host github.com
  Hostname ssh.github.com
  Port 443

参考链接: https://zhuanlan.zhihu.com/p/521340971

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐