TortoiseGit Manual


When you want to embed foreign repositories into a working tree/git repository, this is called a submodule. Here using the TortoiseGitSubmodules Add option a foreign repository can be embedded into a dedicated subdirectory of the source tree. When selecting this option, a dialog pops up:

Figure 2.11. The add submodule dialog

The add submodule dialog

Here you can enter the location/URL of the Repository you want to embed into the directory Path. Path can be entered as a relative path within the active source tree, but can also be an absolute path (pointing to the active source tree). The folder should be empty or non existent. If you don't want to integrate the HEAD of the Repository, you can enter a different Branch. By pressing OK, the entered Repository is cloned and integrated into the current source tree.

If a working tree contains submodules, two new context menu entries are available:

Figure 2.12. Submodule context menu entries

Submodule context menu entries

Submodule Update:

Figure 2.13. The update submodule dialog

The update submodule dialog

Initialize the submodules and/or update the registered submodules, i.e. clone missing submodules and checkout the commit specified in the index of the containing repository.

Submodule Sync: Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules. This is useful when submodule URLs change upstream and you need to update your local repositories accordingly.

Also if a working tree contains submodules, the section called “Checking Out A Working Tree (Switch to commit)” and the section called “Reset” contain a button for updating submodules:

Figure 2.14. Button for updating submodules in progress dialog

Button for updating submodules in progress dialog

You can find more information at the section called “git-submodule(1)”