git clone速度慢解决办法

使用github cnpmjs镜像

当你要clone一个repository,然后特别嫌弃他的速度的时候

可以将本来的

git clone https://github.com/xxx.git

改成:

git clone https://github.com.cnpmjs.org/xxx.git

这样通过代理可以比较轻松地加速

使用git shallow clone来下载

git clone https://github.com/xxx --depth 1
cd xxx
git fetch --unshallow

git clone --depth 1 本身会让clone下来的是最近的一个commit的文件夹状态,而不是整个文件夹的记录

然后git fetch --unshallow可以在之后,将整个文件夹的状态下载下来

猜你喜欢

转载自blog.csdn.net/qq_28686911/article/details/113882756