当前位置:首页 » 《随便一记》 » 正文

git clone 子模块没下载全的问题解决

22 人参与  2020年11月13日 00:00  分类 : 《随便一记》  评论

点击全文阅读


 

这篇文章主要介绍了git clone 子模块没下载全的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。

1. 下载一个包含很多子模块的工程

例如:git clone --recursive https://github.com/caffe2/caffe2

如果网络不好或者其他原因导致子模块没有下载完全,这时用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 --recursive1

如果你不确定子模块是否都已经下载完全了,也可以执行一遍这个命令确认一下。

3. 参考 git clone --help

git 2.7.4版本:

--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)

到此这篇关于git clone 子模块没下载全的问题解决的文章就介绍到这了,更多相关git clone 子模块没下载全内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

文章转自脚本之家,原文链接:https://www.jb51.net/article/193210.htm

申请创业报道,分享创业好点子。,共同探讨创业新机遇!


点击全文阅读


本文链接:http://m.zhangshiyu.com/post/1388.html

<< 上一篇 下一篇 >>

最新文章

  • 军训前,童养媳拿我的病历本给心上人叠纸飞机后,我退婚了完结爽文_杨鹤童养媳阿鹤一口气完结_小说后续在线阅读_无删减免费完结_
  • 未婚夫女兄弟把婚车改成宠物灵车,我反手让她的宾利变破烂最新阅读_魏成鸣乔诗诗林书妍小编推荐_小说后续在线阅读_无删减免费完结_
  • 军训当天男友为校花虐功勋犬,重生后我杀疯了潜力榜_顾野杜璇闻言大结局_小说后续在线阅读_无删减免费完结_
  • 天塌了!大佬们全被我捡回家了阿昭,小白,李惊雪小说整本+后续(阿昭,小白,李惊雪)清爽版阅读
  • 重生八零,我笑看真千金用土气布料卖港商免费阅读_妹妹姜雅沈俊爆款_小说后续在线阅读_无删减免费完结_
  • 秦昭:+后续人物讨喜无套路全集手握一把刀,砍翻万道!
  • 狸奴抓伤阿娘后,我和爹提议换个娘后续_阿爹阿娘宁王最新阅读_小说后续在线阅读_无删减免费完结_
  • 盛夏没有晴天小说(阮苏梨,傅屿安,宋颖)小说结尾+隐藏篇章(盛夏没有晴天阮苏梨,傅屿安,宋颖)畅享阅读
  • 全书浏览天降好运?村西头疯婆子是神医!(李萍萍周大孙月娘)_天降好运?村西头疯婆子是神医!(李萍萍周大孙月娘)全书结局
  • 校园星芒爱与科幻的交织(苏然林悦)全书浏览_校园星芒爱与科幻的交织全书浏览
  • 包浆修复师从核到银河(苏星摇豆汁儿于乾)_包浆修复师从核到银河
  • 小说大结局小说风入江云小说已更新+特别篇(柳江云,喜鹊,萧桉)纯净版

    关于我们 | 我要投稿 | 免责申明

    Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1