Skip to main content

Submodules

Git submodules allow you to embed one Git repository inside another as a subdirectory while keeping their histories separate. They are commonly used to include shared libraries or third-party dependencies directly in a project.

See also Git Submodules in Git documentation.

Viewing Submodules

When you open a repository that contains submodules, they are listed in the Submodules section of the Branches panel.

TODO submodules-panel.png

Each entry shows:

ColumnDescription
NameThe path of the submodule inside the parent repository.
URLThe remote URL the submodule points to.
SHAThe commit SHA the parent repository currently has checked out for the submodule.

Updating Submodules

After cloning a repository or after a pull that changed the recorded submodule commit, the submodule directories may be empty or out of date. To initialise and update all submodules:

  1. Open the Repository menu.
  2. Select Update Submodules.

TODO submodules-update-menu.png

Gitember runs git submodule update --init --recursive in the background. Progress is shown in the status bar.

Synchronising Submodule URLs

If the remote URL of a submodule has changed in .gitmodules, you need to synchronise the recorded URL before updating:

  1. Open the Repository menu.
  2. Select Sync Submodules.

This propagates the new URL from .gitmodules into each submodule's local configuration.

Opening a Submodule

To work inside a submodule as if it were a standalone repository:

  1. Double-click the submodule entry in the Submodules panel.
  2. Gitember opens the submodule in a new tab, allowing you to browse its history, create branches, commit, and push independently.

TODO submodules-open-tab.png

Summary

ActionHow to trigger
View submodulesBranches panel → Submodules section
Initialise / update submodulesRepository menu → Update Submodules
Sync changed remote URLsRepository menu → Sync Submodules
Open submodule as standalone repoDouble-click submodule entry