还在为 GitHub clone 慢、下载 Releases 失败烦恼吗?分享两个方法,简单直接,亲测有效。
方法一:修改 Hosts 文件(手动挡)
老方法,但依然管用。原理是跳过 DNS 解析,直接连上高速 IP 。
-
获取 Hosts: 直接去
https://github.com/521xueweihan/GitHub520复制最新的 hosts 内容。 -
修改文件: 把复制的内容粘贴到 hosts 文件末尾并保存。
- macOS / Linux:
/etc/hosts - Windows:
C:\Windows\System32\drivers\etc\hosts(没权限就先拖到桌面改,再拖回去覆盖)
- macOS / Linux:
-
刷新 DNS:
- Windows:
ipconfig /flushdns - macOS:
sudo killall -HUP mDNSResponder - Linux:
sudo systemd-resolve --flush-caches
- Windows:
缺点: IP 会失效,变慢了就得重复第一步去更新。
方法二:使用反向代理(自动挡)
这个方法更省事,一劳永逸。网上这类公益代理服务很多,核心用法都是替换 URL 。
下面这几个是我测试过,目前都还稳定好用的,挑个顺手的就行:
githubproxy.ccghproxylist.comghfast.topgh-proxy.com

