O'Reilly logo

Pragmatic Version Control Using Git by Travis Swicegood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Git Submodules to Track External Repositories

Sometimes you need to track multiple repositories as if they’re all in the same repository. This might be because of a dependency on some third-party library or possibly because your in-house project has been divided into multiple projects to help make them more manageable.

Git allows you to track external repositories through what it calls submodules. These allow you to store a repository within another repository while keeping the two histories completely independent. Those coming from a Subversion background might recognize these as svn:externals.

Adding a New Submodule

Let’s demonstrate this behavior. First we need to create a new repository that will house our submodule repository. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required