IT lexicon › Programming › git submodule

git submodule

Programming På svenska → Updated: 2026-05-24

A repo inside a repo — points to a specific commit in another git repo. Widely hated but no one's come up with a cleanly better replacement.

git submodule add <url> path, then commit. Problems: easy to forget --recurse-submodules on clone, easy to commit "submodule moved" without actually pushing the submodule first. Alternatives: git subtree (vendoring), monorepo (Bazel, Nx), package manager (npm/Cargo/Go modules).

← Back to the lexicon