Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

git
submodule
communitycreator

How to clone a project that contains Git Submodule

Anjana Shankar

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

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

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring