Analytics
Skip to content

Submodules ​

Manage nested Git repositories within your project.

What are Submodules? ​

Submodules allow you to include other Git repositories within your repository, keeping them as separate projects with their own history.

Common uses:

  • Shared libraries or components
  • Third-party dependencies
  • Separating large projects into modules

Adding a Submodule ​

  1. Go to Repository > Submodules
  2. Click Add Submodule
  3. Enter the repository URL
  4. Choose the local path
  5. Click Add

Cloning with Submodules ​

When cloning a repository that contains submodules:

  1. Clone the repository normally
  2. Go to Repository > Submodules
  3. Click Initialize to download submodule contents

Updating Submodules ​

Update All ​

Click Update All to fetch latest commits for all submodules

Update Individual ​

  1. Right-click a submodule
  2. Select Update

Viewing Submodule Status ​

The Submodules panel shows:

  • Current commit
  • Whether updates are available
  • Modified files within submodules

Making Changes in Submodules ​

  1. Open the submodule as a separate repository
  2. Make changes and commit
  3. Push changes to submodule's remote
  4. Return to parent repo and commit the submodule update

Removing a Submodule ​

  1. Right-click the submodule
  2. Select Remove
  3. Confirm deletion

WARNING

This will remove the submodule reference and optionally delete the files.

Common Issues ​

Submodule Not Initialized ​

If submodule folders are empty:

Go to Repository > Submodules > Initialize

Detached HEAD in Submodule ​

Submodules checkout specific commits, not branches. To work on a branch:

bash
cd path/to/submodule
git checkout main

Released under the MIT License.