[笔记]解决git clone 子模块没下载全的问题
2017-10-21 22:34
716 查看
[笔记]解决git clone 子模块没下载全的问题
★ 1. 下载一个包含很多子模块的工程
例如:git clone --recursive https://github.com/caffe2/caffe2[/code]
如果网络不好或者其他原因导致子模块没有下载完全,这时用git pull是无法下载完全的。
注:这是在英文环境中执行的结果,英文Submodule在中文环境中翻译为“子模组”了。
从log中可以看出,有很多子模块(为节省篇幅,完整log略,可以自行下载测试)。$ git clone --recursive https://github.com/caffe2/caffe2 Cloning into 'caffe2'... remote: Counting objects: 36771, done. remote: Compressing objects: 100% (12/12), done. remote: Total 36771 (delta 6), reused 7 (delta 5), pack-reused 36754 Receiving objects: 100% (36771/36771), 149.13 MiB | 2.76 MiB/s, done. Resolving deltas: 100% (26926/26926), done. (这里只以子模块protobuf为例,其他子模块略) Submodule 'third_party/protobuf' (https://github.com/google/protobuf.git) registered for path 'third_party/protobuf' (略) Cloning into 'third_party/protobuf'... remote: Counting objects: 47717, done. remote: Compressing objects: 100% (49/49), done. remote: Total 47717 (delta 23), reused 23 (delta 5), pack-reused 47657 Receiving objects: 100% (47717/47717), 40.97 MiB | 59.00 KiB/s, done. Resolving deltas: 100% (32097/32097), done. Checking connectivity... done. Submodule path 'third_party/protobuf': checked out 'a428e42072765993ff674fda72863c9f1aa2d268' (略)★ 2. 下载子模块
git submodule update --init --recursive
如果你不确定子模块是否都已经下载完全了,也可以执行一遍这个命令确认一下。★ 3. 参考
git 2.7.4版本:git clone --help--recursive, --recurse-submodules After the clone is created, initialize all submodules within, using their default settings. This is equivalent to running git submodule update --init --recursive immediately after the clone is finished. This option is ignored if the cloned repository does not have a worktree/checkout (i.e. if any of --no-checkout/-n, --bare, or --mirror is given)
git 2.14.1版本:--recurse-submodules[=<pathspec] After the clone is created, initialize and clone submodules within based on the provided pathspec. If no pathspec is provided, all submodules are initialized and cloned. Submodules are initialized and cloned using their default settings. The resulting clone has submodule.active set to the provided pathspec, or "." (meaning all submodules) if no pathspec is provided. This is equivalent to running git submodule update --init --recursive immediately after the clone is finished. This option is ignored if the cloned repository does not have a worktree/checkout (i.e. if any of --no-checkout/-n, --bare, or --mirror is given)
相关文章推荐
- STM32F10x 学习笔记之解决JLink 无法下载程序的问题
- 定时任务执行git clone出现permission denied(publickey)问题的解决
- 【cocos2d-x 3.X自学笔记】[转]Eclipse配置安卓开发环境(解决SDK manager下载慢问题)
- git clone下载第三方包遇到的问题
- 解决一个小问题:git下载Kernel源码时只有.git\objects\pack目录下的.pack文件,而没有自动提取
- 解决git clone失败的问题
- [笔记]--Git遇到的问题及解决办法
- git clone 下载速度0bytes 出现error: RPC failed; curl 18 transfer closed with outstanding read data 解决办法
- git太大无法下载的问题解决
- 【已解决】Ubuntu下git clone 无法连接问题
- android N7.1 下载fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle 解决方法
- 解决 drush make 2.3 下载的模块找不到的问题
- linux显示git commit id,同时解决insmod模块时版本不一致导致无法加载问题
- git clone 失败问题解决方案
- [PAAS] Heroku git clone 问题解决
- 解决git clone 慢问题
- 解决CSDN的code功能,无法git clone多个项目的问题
- git笔记之解决eclipse不能提交jar等文件的问题
- Bonobo.Git.Server解决下载文件问题