Tower Icon

Update a Submodule

When someone else has moved the revision pointer for a submodule and you merge in this change, your revision pointer will not automatically be updated by Git on the Command Line (see "The Trouble with Submodules").

Tower will notify you if a submodule’s pointer has been changed after an operation and will ask you to update the revision pointer accordingly. You can also set “Always update submodule” for each submodule to have its revision pointer moved automatically for you without being notified.
This makes working with submodules a lot easier – especially in the (very likely) case that you treat submodules as read-only libraries in your project where you always want to update the revision pointer.


Switching Branches with Submodules

Automatic updating also works when switching branches: if the revision pointer of any submodule changes, Tower will offer to update it for you.

By default, Tower will also remove submodules from the working tree for you that do not exist on the current branch. By default, Git just leaves them as untracked folders in your working tree – a very irritating side effect. However, this is only supported for submodules that have been created with Git version 1.7.8 or greater, as from this version on Git introduced an important improvement to submodules that does not require you to fully re-clone a submodule when you fully delete it from the working tree.


Related Topics

Introduction to Git Submodules

Managing Submodules

Fetching Submodule data

Moving the revision pointer for a Submodule