GitHub无法访问、443 Operation timed out

问题

提交git出现443超时错误

fatal: unable to access 'https://github.com/xwLyc/xwLyc.github.io.git/': Failed to connect to github.com port 443: Operation timed out

经过各种百度谷歌搜索要求设置git代理,我用的clash,代理端口7890

git config --global https.proxy http://127.0.0.1:7890
git config --global http.proxy http://127.0.0.1:7890

然而,无效。

解决方案

1. 打开 https://github.com.ipaddress.com/ 如下图

pic

把IP Address 记录下来! 把IP Address 记录下来! 把IP Address 记录下来!

2. 打开https://fastly.net.ipaddress.com/github.global.ssl.fastly.net#ipinfo 如下图:

pic

把IP Address 记录下来! 把IP Address 记录下来! 把IP Address 记录下来!

3. 打开https://github.com.ipaddress.com/assets-cdn.github.com 如下图:

pic

把IP Address 记录下来! 把IP Address 记录下来! 把IP Address 记录下来!

4. 打开电脑的hosts文件,把下列的地址,然后保存即可(mac 使用switchhost打开)

# My hosts
140.82.112.4 github.com #图1的IP Address
199.232.5.194 github.global.ssl.fastly.net #图2的IP Address
185.199.108.153 assets-cdn.github.com #图3的IP Address
185.199.109.153 assets-cdn.github.com #图3的IP Address
185.199.110.153 assets-cdn.github.com #图3的IP Address
185.199.111.153 assets-cdn.github.com #图3的IP Address

5. 在终端在输以下指令刷新DNS(需要权限)

sudo killall -HUP mDNSResponder;say DNS cache has been flushed

然后就见证神奇的时刻!!!!!

参考文章:https://juejin.cn/post/6844904193170341896

打赏一个呗

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦