Pull git submodules after cloning project from GitHub

From the root of the repo just run:

git submodule update --init

I just want to share these.

First way,

git submodule init && git submodule update

The below is just basically combining the first way,

git submodule update --init

If there are any nested submodules, Iglesk's answer is the way to go.


If you need to pull stuff for submodules into your submodule repositories use

git pull --recurse-submodules

But this will not checkout proper commits(the ones your master repository points to) in submodules

To checkout proper commits in your submodules you should update them after pulling using

git submodule update --recursive

If there are nested submodules, you will need to use:

git submodule update --init --recursive