今天上午写demo的时候,突然pull不下代码了,报了一下这样情况的错误:
关于github报错 ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository. 随笔 第1张

关于github报错 ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository. 随笔 第2张

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

关于github报错 ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository. 随笔 第3张

看了一下代码,怀疑是网路错误,因为在这以前一切都正常的,然后将代码复制搜索了一番,解决办法有很多什么配置config啦,git config --local -e啦,能试的都测试了,还是不行,最后,不想当时浪费太多开发时间,所以就放下了,大概两个半小时后,又git pull 一下就成功了,没原由的自己好了,当时心里一万个xxx

下面是github如何配置公钥:

在本地生成公钥: ssh-keygen -t rsa -C email@xx.com
进入github 设置

关于github报错 ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository. 随笔 第4张

进入设置找到对应配置ssh的位置,将 rsa 文件中的内容复制到github ssh中

查看是否配置成功:ssh -T git@github.com

注意:要clone带ssh的项目

ctrl+l 将界面移动到最上方输入显示

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄