Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pull using git including submodule

Tags:

git

github

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

like image 855
adit Avatar asked Nov 11 '11 07:11

adit


People also ask

Does git pull also update submodules?

With Git 2.34, if the repository is cloned with the --recurse-submodules , a simple git pull will recurse into submodules.

Does git clone pull submodules?

It automatically pulls in the submodule data assuming you have already added the submodules to the parent project. Note that --recurse-submodules and --recursive are equivalent aliases.

How do you clone with submodules?

Git clone with submodules The list of steps required to clone a Git repository with submodules is: Issue a git clone command on the parent repository. Issue a git submodule init command. Issue a git submodule update command.


1 Answers

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...

like image 169
Dietrich Epp Avatar answered Oct 12 '22 23:10

Dietrich Epp