Back to lessons
Managing Submodules
Include external repositories within your project as submodules.
Step 1 of 520%
Submodules let you include other Git repositories as subdirectories in your project. They pin to a specific commit, so your project always uses a known version of the dependency.
Submodules solve a common problem: how do you depend on an external library without copying its code into your repository? Unlike npm or pip packages, submodules keep a reference to the external repo's exact commit, so your project is always reproducible. This is especially useful for monorepo-style setups or when you need to vendor a specific version of a library that isn't published to a package manager.
1 / 5