前言
github做为一个庞大的开源“宝库”, 作为程序猿我相信你不会陌生的,里面有着众多的开源项目, 可是当我们准备去(bai)下(piao)载时却往往会很shang
目前在国内从github下载速度大概在20kb/s左右,如此的速度对于较小的文件还好,如果大一点的, 运气好还能下载下来,运气不好直接给你来个删除线.
最近也有一些小伙伴反应,github 怎么下载这么慢还总是容易失败, 怎么破? 下面请听我weiwei道来.
1. 代码下载(git clone)
假设这里我们下载spring-framework的源码
源码地址如下:
https://github.com/spring-projects/spring-framework
如果我们直接 clone

- 可见下载速度仅有15kb/s 这个速度能忍?
「解决方案」
这里推荐使用github的镜像网站进行下载
https://github.com.cnpmjs.org/
「替换规则如下:」
- https://github.com/spring-projects/spring-framework --- 原本的
- https://github.com.cnpmjs.org/spring-projects/spring-framework --- 替换后的
此时我们再去clone 替换后的这个地址

- 对比你会发现 不是一个级别的速度 前面的像是在「爬行」 后面简直是「飞滴」
「小结」
这里不局限于这一个镜像地址哈,其他的小伙伴们自行挖掘哦
2. Release 包下载
关于下载文件,上面的方法就不能使用了
这时候可以使用使用一些开发者提供的代理下载功能这里推荐使用
https://d.serctl.com/
下面演示一下
这里拿下载spring-framework的发布包为例 下载地址如下
https://github.com/spring-projects/spring-framework/archive/v5.3.3.zip
直接通过浏览器下载速度如下

访问 https://d.serctl.com/ 并输入拷贝进去下载地址 并提交

稍等片刻,下面的下载历史会出现我们要下载的文件

任选一个该文件的下载地址,再用浏览器去下载试试

- 因包较小,我这面截图较快,速度还会更快一些
- 与直接下载对比 下载速度依旧不是一个单位级别的.
「小结」
这里不局限于如上一个镜像代理下载地址哈
下面的都是:
- http://toolwa.com/github/
- https://www.offcloud.com/
- http://gitd.cc/
- https://g.ioiox.com/
- https://gh.api.99988866.xyz/
还有其他的,小伙伴们自行挖掘哦。