用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.comHostname ssh.github.comPort 443
参考链接: https://zhuanlan.zhihu.com/p/521340971