Barry Fruitman
Barry Fruitman

Reputation: 12664

How do I add a git submodule located in another repository?

I added a git submodule from a 3rd-party remote repo to my project. It updated the .gitmodules file, which I then pushed to my remote repo. Now when I clone my project from my remote repo, I still don't see the new submodule. I DO see the new .gitmodules, but that's it. Even running "git submodule update --init" doesn't help. The only thing that works is adding the submodule again (with git submodule add...).

How do I permanently include my new submodule so that it is cloned automatically with the rest of my project?

Thanks in advance...

Upvotes: 0

Views: 41

Answers (1)

ArtemB
ArtemB

Reputation: 3632

git clone --recurse-submodules should do the trick.

You can also do git submodule update --init --recursive to init submodules if you already did the clone.

Upvotes: 1

Related Questions