DEV Community

Cover image for How to clone a repository including the submodules or sub repositories in Git?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

How to clone a repository including the submodules or sub repositories in Git?

Originally posted here!

Sometimes we may want to clone a repository which in turn contains sub repositories or sub-modules. We can clone these sub-modules by passing --recurse-submodules flag to the git clone command.

It can be done like this,

git clone --recurse-submodules <GIT_REPO_URL>
Enter fullscreen mode Exit fullscreen mode

This will fetch all the submodules included in the main repository. 🌟

Feel free to share if you found this useful 😃.


Top comments (0)