回顾性地添加 - 对git仓库进行递归 [英] Retrospectively add --recursive to a git repo

查看:103
本文介绍了回顾性地添加 - 对git仓库进行递归的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你 git clone - 递归,你也可以获得所有的git子模块。



如果我忘记在克隆时添加这个神奇旗帜,可能会发生,我该如何去获取任何子模块?



另外,如何将递归标志设置为未来克隆的默认值? 这在一个简单的顶级克隆之后:

  git submodule update --init --recursive 

我不推荐使用克隆默认做这个。如果您正在积极地使用子模块进行开发,而不是仅仅链接到github上的第三方OSS库(您可以在蓝色月亮中升级一次),那么正确的方法是使用 git slave 子树



希望这有助于您。


If you git clone with --recursive, you can get all the git submodules too.

If I've forgotten to add this magical flag when cloning, as can happen, how do I now go and get any submodules?

Additionally, how can I set the recursive flag as a default for future clones?

解决方案

You can do it with this after a simple top-level clone:

git submodule update --init --recursive

I would not recommend making clone do this by default. The proper way to do this if you are using submodules aggressively for development and not just linking to 3rd party OSS libs on github that you may upgrade once in a blue moon, is to use git slave or subtree.

Hope this helps.

这篇关于回顾性地添加 - 对git仓库进行递归的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆