Split and recombine a Git repository with submodules
8 steps · about 2 h 35 min · Intermediate
- Understand the superproject pointer (guide, Pro Git, 35 min)
See that the parent records one exact child commit rather than embedding the child working tree.
- Map the submodule commands (reference, Git documentation, 24 min)
Use add, status, init, update, sync and deinit with a clear model of their scope.
- Learn the stored configuration (reference, Git documentation, 22 min)
Distinguish the tracked .gitmodules file from local configuration and internal Git directory data.
- Review paths, URLs and update policy (reference, Git documentation, 18 min)
Keep repository locations and optional branch or update choices visible in code review.
- Clone before adding nested dependencies (guide, GitHub Docs, 14 min)
Begin from a complete local superproject and verify its remote before introducing independently versioned content.
- Review pointer movement (reference, Git documentation, 14 min)
Inspect the child commit recorded by a parent pointer update instead of accepting an opaque hash change.
- Fetch child history deliberately (reference, Git documentation, 12 min)
Control recursive fetching while preserving warnings that protect unavailable or uncommitted child work.
- Remove the tracked path cleanly (reference, Git documentation, 16 min)
Delete the submodule entry and path in a reviewable change, then inspect remaining local metadata before cleanup.