adit
adit

Reputation: 33644

pull using git including submodule

In one of my iOS project I have add a sub-module added, lets say a friend of my wants to pull it including the submodule, how can he do this? Whenever I tried to download the zip file from github it doesn't pull the submodule along with it

Upvotes: 51

Views: 51622

Answers (2)

Dietrich Epp
Dietrich Epp

Reputation: 213268

That's by design. Get the submodules as a second step.

git clone git://url...
cd repo
git submodule update --init

Then afterwards, add another step after the git pull.

git pull ...
git submodule update --recursive

Of course, this only works if the submodules are set up correctly in the first place...

Upvotes: 98

Mark Longair
Mark Longair

Reputation: 467031

You can clone with the --recursive option in order to automatically initialize and update the submodules (and any submodules that those submodules contain, etc.)

git clone --recursive <URL-OF-REPOSITORY>

Upvotes: 68

Related Questions