git init git remote add origin <url> git fetch --depth 1 origin <sha1> git checkout FETCH_HEAD通过--depth 1限定shallow clone,只clone相关的一级深度,这样就可以大大加快clone的速度另:如果有仓库sub modules,还可以用shallow clone的方式一并clone sub modules:git clone --branch <sha1/branch/tag> --recursive -j$(nproc) --depth 1 <git repo>see: https://stackoverflow.com/a/6...
通过
--depth 1
限定shallow clone
,只clone相关的一级深度,这样就可以大大加快clone的速度另:
如果有仓库sub modules,还可以用shallow clone的方式一并clone sub modules:
see: https://stackoverflow.com/a/6...