Search code examples
gitgit-submodulesgit-pull

Will git pull include new submodules?


When I clone a repository with the following command, it automatically includes submodules.

git clone --recursive https://github.com/xxxxxxxx

I have a question. If you later update the repository with git pull, will it include the newly added submodules? (if there is a newly added submodule)


Solution

  • If there is any new submodule added, you may have to use

    git submodule update --init --recursive
    

    Post that, the following should be suffice

    git pull --recurse-submodules