提高git clone速度的方法

采用国内镜像网站https://hub.fastgit.org/
clone时在仓库链接中添加镜像网站即可

git clone https://hub.fastgit.org/xxx/xxxx.git

git clone –recursive

对于含有子模块,可以先不要在git clone的时候加上--recursive。
等主体部分下载完之后,主体文件夹中有个隐藏文件称为:.gitmodules,使用vim打开,
把子项目中的url地址同样加上hub.fastgit.org,然后利用git submodule sync更新子项目对应的url
最后再git submodule update --init --recursive,即可正常网速clone完所有子项目。

本文来自博客园,作者:甫生,转载请注明原文链接:https://www.cnblogs.com/fusheng-rextimmy/p/15385656.html

原文地址:https://www.cnblogs.com/fusheng-rextimmy/p/15385656.html