For the sake of completion, I combined the answers to cover recursive cases too, hopefully, this can serve as a complete answer for the community.
Since you've previously cloned a repository, the submodules need to be properly synced, re-initialized (since your local .git/config
file would not be synced) and pulled recursively:
git pull
git submodule init
git submodule update --recursive
Following @mufidu's answer, I separated the main part into wo steps.
The second line, updates your local .git/config
(untracked) file by copying information about the submodule into it -- based on the .gitmodules file
. It doesn't actually update any tracked file or code or the content of the submodules.
Note that since you already have cloned, the local .git/config
file (which is like a cache), most likely will be out of sync (and incorrect) and won't be fixed otherwise.
The first line, git pull ...
, is to emphasize that it is already cloned, and to cover the answers that suggested git pull --recurse-submodules
.
git pull --recurse-submodules
– Tedious