快速clone GitHub上的项目方法
下载GitHub项目最高效的方式
最近要在GitHub上下载一个项目,用普通的方式下载慢的要命,2.5G的大工程下了一个星期都不行,中间老是出现如下问题。
error: RPC failed; result=56, HTTP code = 200B | 54.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: 过早的文件结束符(EOF)
fatal: index-pack failed
网上一查原来的git的缓存太小,用如下命令解决
sudo git config --global https.postBuffer 5242880000
一不小心又查到一篇文章,彻底把我惊呆了。2.5G的工程不到5分钟就下来了。
方法就是使用国内镜像网站
目前已知Github国内镜像网站有github.com.cnpmjs.org和git.sdut.me/。速度根据各地情况而定,在clone某个项目的时候将github.com替换为github.com.cnpmjs.org即可。
原文为:https://blog.csdn.net/weixin_42886104/article/details/106454331