Home > Back-end >  How to add git submodule with nested submodules?
How to add git submodule with nested submodules?

Time:03-18

How to add a submodule with nested submodules?

When I do the following only the root submodule is added. How to add all submodules in the submodule recursively?

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

In the above submodule there is a nested submodule and the folder is not even created after cloning

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

The main project is on github and the submodule is gitlab (with including nested submodules)

CodePudding user response:

After cloning you have to init recursively with

git submodule update --init --recursive

This will do what you want

  •  Tags:  
  • git
  • Related