Git submodules stellen je in staat om één Git-repository in een ander in te bedden als een subdirectory — nuttig voor het opnemen van gedeelde bibliotheken of afhankelijkheden als afzonderlijke repos. Ze zijn krachtig maar hebben een reputatie voor complexiteit, dus het begrijpen ervan en de alternatieven is waardevol.
Wat submodules zijn
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
