I have a local repository which contains multiple submodules.
I want to keep my local repository's master branch always up-to-date with the upstream repository (The upstream repo also contains the same submodules; here "up-to-date" means my local repo is exactly like a mirror version of the upstream in terms of both parent repo and submodules). I get confused by the --recurse-submodules
option in git pull
.
a): git pull origin master --recurse-submodules
b): git pull origin master
I was wondering what exactly --recurse-submodules
means? If I do not add this option, will the submodules in my local repo get updated?
I also found the command to update only the submodules :git submodule update (--remote)
. Do I also need to perform this command in addition to a)
or b)
.
By the way, Can anyone let me know the common/typical workflow as to keep a local repo with submodules up-to-date?
PS: my submodules are all initialized. I am working with github. Git version 2.11.0
Thank you!