ironsand
ironsand

Reputation: 15181

Submodule isn't cloned when main repository are cloned

I have a project main and small project small. To make small as a submodule of main, I've done like this:

cd main_project
git submodule add [email protected]:ironsand/small.git small
git add .gitmobules
git commit -m "add submodule small"
git push

And in another directory I run git clone [email protected]:ironsand/main.git, but the small subdirectory is empty.

This is the first time I use submodule function of git, so probably I'm doing something wrong. Could you tell me how to clone submodule when main repository is cloned?

Upvotes: 0

Views: 41

Answers (1)

Anshul Goyal
Anshul Goyal

Reputation: 77093

When doing a clone, do a recursive clone for cloning the submodules as well

git clone --recursive [email protected]:ironsand/main.git

Upvotes: 1

Related Questions