Search code examples
gitgit-submodules

What is the difference between these two git commands to update latest submodules?


git pull --recurse-submodules

vs.

git submodule update --recursive --remote

I have seen these two been used in the same context when updating/pulling the latest submodules, but I can't find the difference between them and when to use which?


Solution

  • The 1st affects (pull) the whole repo and submodules. The 2nd updates only the submodules.

    Here is https://stackoverflow.com/a/19621245/418599 a similar question that can be tailored to yours.