Submodules

Submodules allow you to include other Git repositories within a Git repository and can be managed directly inside of GitKraken.


Adding submodules

Add a submodule by clicking the when hovering over Submodules in the left panel. Paste the HTTPS or SSH link to the repository, and then enter the path.

Adding a submodule to the repository adds a link to the submodule's repository in the .gitmodules file.

When the parent repository is cloned, it includes the reference to any submodules and the submodules require initialization.

Your repository tracks the submodule's checked out commit. If there are any updates to the submodule, the files will not automatically update your working directory.

Updating submodules

To update submodules, navigate to the Submodule pane in the left panel and right click on the submodule.

If you clone a repository that contains a submodule, you will be prompted to initialize the submodule. This will clone the submodule's repository and check out the referenced commit.

Statuses

Below are possible statuses of your submodules and their remedies:

  • Out of sync -- The checked out commit of the submodule has changed. There is a change to the submodule reference in your work in progress that should be stashed, committed or discarded.

  • Added but not initialized -- Right click and select initialize.

  • Added and initialized but not committed -- When adding a submodule, commit the submodule folder to the repository and insert the reference to the submodule in the .gitmodules file.

GitKraken and subtree, not submodules

GitKraken does not currently support subtree in-app.