前言
- 利用镜像下载
- 通过代理网站下载
- Gitee中转fork仓库下载
- 修改 HOSTS 文件进行加速
- 梯子(略)
利用镜像下载
第一种 安装油猴插件和脚本
https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
第二种 安装GitHub加速插件
https://chrome.google.com/webstore/detail/github%E5%8A%A0%E9%80%9F/ffjjnphohkfckeplcjflmgneebafggej
通过代理网站下载
Release、Code(ZIP) 文件加速:
- https://gh.api.99988866.xyz
- https://github.rc1844.workers.dev
- https://ghgo.feizhuqwq.workers.dev
- https://git.yumenaka.net
- https://github.com.cnpmjs.org
- https://mirror.ghproxy.com/
- https://ghproxy.com/
- https://toolwa.com/github/
Git Clone 加速:
具体哪个速度快,请自行找一些大文件来测速。
Gitee中转fork仓库下载
访问 gitee
网站并登录,在顶部选择“从GitHub/GitLab
导入仓库” 如下
在页面中粘贴你的Github仓库地址,点击导入即可
导入成功,git clone
仓库,下载速度可以达到2MB/s
,就是有点费事。
修改HOSTS文件进行加速
自从 2021.3 月初某会开始,很多地区已经间歇性无法访问 Github 了。
这种情况无论是改 DNS 还是改 Hosts 都没用,因为对 Github 域名 SNI 干扰/封锁,任意 IP 指向 Github 去访问时,该 IP 的 443 端口就会超时 3 分钟!
因为是随机干扰的,所以有时候会碰到 “短暂” 可用的 IP
有兴趣可以看看这篇详细讲解分析的文章:https://www.v2ex.com/t/758568
所以修改HOSTS文件进行加速方法是否还有效,可以自测。
定时同步
添加一条规则:
- 方案名:GitHub
- 类型:远程
- URL 地址:
https://gitee.com/ineo6/hosts/raw/master/hosts
- 自动更新:1个小时
刷新DNS缓存
打开终端,输入对应命令
// Mac用户
sudo killall -HUP mDNSResponder
// Win
ipconfig /flushdns
有兴趣可以阅读文章SwitchHosts! 还能这样管理 hosts,后悔没早点用 了解详情,里面有介绍以及各个平台刷新 DNS 缓存的方法。
参考
- https://github.com/ineo6/hosts
- https://www.beiwangshan.com/205.html
- https://greasyfork.org/zh-CN/scripts/412245-github-%E5%A2%9E%E5%BC%BA-%E9%AB%98%E9%80%9F%E4%B8%8B%E8%BD%BD
链接:https://www.jianshu.com/p/bdf361ff3578