Git Submodules and Shared Packages in Teams

Git submodules are useful for shared repositories with their own lifecycle. That includes design systems, internal tools, templates, or packages without a separate publication flow.

  • one project uses another revision of shared code than the next one
  • updates stay hard to trace in the main project
  • important subdirectories are missing after clone
  • delivery stops because the module is missing in automation

Set up an existing project with submodules

bash

This step fetches missing submodule content directly during clone or afterwards into the project.

Add a shared repository as a submodule

bash

That fixes where the submodule lives in the project and which branch serves as the reference. The main project always stores one concrete commit of the submodule.

  • changes stay traceable
  • updates happen deliberately and in a controlled way
  • the main project must explicitly adopt each new state

Maintain submodule states in the team

bash

This workflow keeps main project and submodule on the same state and makes changes traceable in the team.

Load submodules in automation

bash

Use cases for submodules

Submodules fit shared repositories with their own lifecycle and a clear separation from the main project.

  • internal tools
  • templates and boilerplates
  • shared configuration collections
  • private design systems or resources with their own lifecycle

Benefit in day-to-day team work

Clear submodule states make shared dependencies traceable and keep main project and child repository in a verifiable relationship.

Hosted in 🇩🇪 by

manitu
© 2026  |  Armin Kunkel  |  Author, Software Developer, Lecturer, Computer Scientist  |  Karlsruhe