如何添加带有嵌套子模块的 git 子模块?

How to add git submodule with nested submodules?

如何添加带有嵌套子模块的子模块?

当我执行以下操作时,只添加了根子模块。如何递归添加子模块中的所有子模块?

git submodule add https://the-submodule.git path/to/submodule

在上面的子模块中有一个嵌套的子模块,克隆后甚至没有创建文件夹

path/to/submodule                   <- root submodule
path/to/submodule/nested-submodule  <- nested submodule (folder not even created)

主项目在github上,子模块是gitlab(包括嵌套子模块)

克隆后你必须用

递归初始化
git submodule update --init --recursive

这会做你想做的事