git clone一个github上的仓库非常缓慢,简单快捷的方法解决git下载缓慢问题
文章目录:
1 问题描述
在使用git clone url
克隆一个仓库时,下载速度只有几kb
,这种龟速谁能受得了,看着这个速度简直就要原地爆炸。但是你再浏览器中访问github主页是没有问题的,速度也是很快的。
2 解决git clone下载速度缓慢问题
下面有几种方法,其中第一种方法亲测有效,其他方法大家自行测试
2.1 使用github的镜像网站 (亲测好用)
- github的域名:
github.com
- github的镜像域名:
github.com.cnpmjs.org
我们只需要克隆的github的域名改成github的镜像域名即可。
举例:
例如,我们克隆mmdetection
,正常是使用如下的命令:
https://github.com/open-mmlab/mmdetection.git
使用github镜像之后的命令变成如下形式:
https://github.com.cnpmjs.org/open-mmlab/mmdetection.git
记忆:cnpmjs.org
(擦你皮马甲s.org
)
测试结果,速度有100倍的提升,真的很快的
另外还有两个镜像:
https://hub.fastgit.org/open-mmlab/mmdetection.git
https://github.91chifun.workers.dev//https://github.com/open-mmlab/mmdetection.git
2.2 使用代理
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
还有很多其他的方法,大家自己去探索吧
3 github网页打不开
参考:https://www.zhihu.com/question/27159393
参考:https://www.cnblogs.com/seniortestingdev/p/13393785.html
参考:https://www.eet-china.com/mp/a28267.html