Git Submodules

Include one Git repository inside another using submodules.

On this page

What is a submodule?

A submodule is a repository embedded inside another repository.

Add submodule

git submodule add repository_url path

Initialize submodules

git submodule update --init

When to use

  • Shared libraries
  • Vendor dependencies