Administrator
发布于 2023-06-16 / 82 阅读 / 0 评论 / 0 点赞

Git访问github问题解决的一般方法

添加本地解析

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

image-20230616003451175

这是我的查询结果:

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是可以解决问题的


评论