Updating a submodule

suggest change

A submodule references a specific commit in another repository. To check out the exact state that is referenced for all submodules, run

git submodule update --recursive

To move each submodule’s checkout onto the latest commit of a remote branch instead of the recorded gitlink:

git submodule foreach git pull <remote> <branch>

or use the default git pull arguments

git submodule foreach git pull

Note that this will just update your local working copy. Running git status will list the submodule directory as dirty if it changed because of this command. To update your repository to reference the new state instead, you have to commit the changes:

git add <submodule_directory>
git commit

Local commits in a submodule can conflict with that pull. --rebase replays those commits on top of the upstream instead of merging:

git submodule foreach git pull --rebase

To checkout the latest state of a specific submodule, you can use :

git submodule update --remote <submodule_directory>

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents