Github无法读取远程仓库

主页

Git无法访问

今早起来访问Github炸了,Git不能用了,提示:

➜  practical-crypto git:(master) git pull
Connection closed by 20.205.243.166 port 22
致命错误:无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。

昨天还好好的,今天咋就WFT了~ 从网上找了一圈没解决问题。

  • 重新生成ssh rsa密钥,并上传到github(not work)
  • 重新安装最新版ssh(not work)
  • 重新生成ed25519密钥,并上传到githb(not work)
  • 重新安装openssl、openssh(not work)

解决方案

解决方式也比较奇葩,因为Github官网其实有很多后台服务,这个不能用我们就换一个,我们通过hosts文件配置本地域名,如下:

➜  practical-crypto git:(master)  vim /etc/hosts
#20.205.243.166 github.com
20.201.28.152 github.com

配置后,我们重新拉取仓库代码

➜  practical-crypto git:(master) git pull
remote: Enumerating objects: 115, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 115 (delta 1), reused 6 (delta 0), pack-reused 95
接收对象中: 100% (115/115), 156.24 KiB | 184.00 KiB/s, 完成.
处理 delta 中: 100% (52/52), 完成.

问题解决。

Github可用服务地址

Github可用服务地址

  "git": [
    "192.30.252.0/22",
    "185.199.108.0/22",
    "140.82.112.0/20",
    "143.55.64.0/20",
    "2a0a:a440::/29",
    "2606:50c0::/32",
    "20.201.28.151/32",
    "20.205.243.166/32",
    "20.87.245.0/32",
    "20.248.137.48/32",
    "20.207.73.82/32",
    "20.27.177.113/32",
    "20.200.245.247/32",
    "20.175.192.147/32",
    "20.233.83.145/32",
    "20.29.134.23/32",
    "20.201.28.152/32",
    "20.205.243.160/32",
    "20.87.245.4/32",
    "20.248.137.50/32",
    "20.207.73.83/32",
    "20.27.177.118/32",
    "20.200.245.248/32",
    "20.175.192.146/32",
    "20.233.83.149/32",
    "20.29.134.19/32"
  ]
posted @ 2024-01-17 11:45  warm3snow  阅读(148)  评论(0编辑  收藏  举报