提高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完所有子项目。

posted @ 2021-10-09 14:41  甫生  阅读(188)  评论(0编辑  收藏  举报