Git submodules आपको एक Git repository को दूसरे के अंदर एक subdirectory के रूप में embed करने देते हैं — साझा libraries या dependencies को अलग repos के रूप में शामिल करने के लिए उपयोगी। ये शक्तिशाली हैं लेकिन complexity के लिए प्रतिष्ठा रखते हैं, इसलिए इन्हें और alternatives को समझना मूल्यवान है।
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
