Los submódulos de Git te permiten incrustar un repositorio de Git dentro de otro como un subdirectorio — útil para incluir bibliotecas compartidas o dependencias como repositorios separados. Son poderosos pero tienen reputación de complejidad, así que comprenderlos y conocer las alternativas es valioso.
Qué son los submódulos
A SUBMODULE is a reference to ANOTHER Git repository at a SPECIFIC COMMIT, embedded in
your repo as a subdirectory:
→ the parent repo records WHICH repo and WHICH commit (a pinned reference, not a copy)
→ the submodule is its own repo with its own history
→ Used to include shared libraries/components that are themselves versioned repos.
git submodule add <url> path/to/lib
git --recurse-submodules <url>
git submodule update --init --recursive
git submodule update --remote
