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
With Git 2.34, if the repository is cloned with the --recurse-submodules , a simple git pull will recurse into 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.
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.
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With