a concise shot of dev knowledge
Become a Contributor
Concise shots of dev knowledge

RELATED TAGS

git
submodule
communitycreator

How to clone a project that contains Git Submodule

Anjana Shankar

Git submodules are a powerful way to use git as an external dependency management tool (this is analogous to creating a soft link on your system). This shot covers what will need to be done if you are cloning a project that has a submodule in it.

When you clone a project with submodules, you will get the directories that contain the submodules by default, but they won’t have any of the files within them yet. There are two ways in which you can get these files.

The first method is a combination of following two commands:

git submodule init
git submodule update

The second method is to pass a --recurse-submodules to the git clone command while cloning the repository:

git clone <respository_url> --recurse-submodule

RELATED TAGS

git
submodule
communitycreator
RELATED COURSES

View all Courses

Keep Exploring

Learn in-demand tech skills in half the time

Copyright ©2022 Educative, Inc. All rights reserved.

soc2