添加本地解析
解析github相关域名到正确的ip上,具体的ip可以通过如"ipaddress.com"、"iplocation.net"或"whois.net"等查询,如下图

这是我的查询结果:
192.30.255.113 github.com
185.199.108.153 assets-cdn.github.com
151.101.1.194 github.global.ssl.fastly.net
设置代理:
git config --global https.proxy http://127.0.0.1:1080
git config --global http.proxy http://127.0.0.1:1080
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
清理dns
windows下
ipconfig /flushdns
mac下
sudo killall -HUP mDNSResponder;say DNS cache has been flushed
使用以上手段,一般的问题是都可以解决了!目前来看用绑定hosts是可以解决问题的