Git submodules σας επιτρέπουν να ενσωματώσετε ένα Git repository μέσα σε ένα άλλο ως υποκατάλογο — χρήσιμο για να συμπεριλάβετε κοινές βιβλιοθήκες ή εξαρτήσεις ως ξεχωριστά repos. Είναι ισχυρά αλλά έχουν φήμη πολυπλοκότητας, οπότε η κατανόησή τους και των εναλλακτικών λύσεων είναι πολύτιμη.
Τι είναι τα submodules
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
