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
This step fetches missing submodule content directly during clone or afterwards into the project.
Add a shared repository as a submodule
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
This workflow keeps main project and submodule on the same state and makes changes traceable in the team.
Load submodules in automation
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.
