git submodule update — initialize and update all submodules
Quick Answer
# Initialize and update all submodules (run after git clone)
git submodule update --init --recursive
When to use this
You cloned a repository that uses submodules and the submodule directories are empty, or a teammate added a new submodule and your local copy is out of date.
Other causes & fixes
Clone a repo and initialize submodules in one command
git clone --recurse-submodules https://github.com/user/repo.git
Pull latest changes in all submodules
git submodule update --remote --recursive
Show submodule status
git submodule status
Related