Git submodules ਤੁਹਾਨੂੰ ਇੱਕ Git repository ਨੂੰ ਦੂਸਰੇ ਦੇ ਅੰਦਰ ਇੱਕ subdirectory ਵਜੋਂ embed ਕਰਨ ਦਿੰਦੇ ਹਨ — ਸਾਂਝੀ libraries ਜਾਂ dependencies ਨੂੰ ਵੱਖ-ਵੱਖ 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
