Chapter 8. Vendoring dependencies as submodules

This chapter covers

  • When submodules are useful
  • Adding a submodule to a repository
  • Viewing the status of the submodules in a repository
  • Updating and initializing all submodules in a repository
  • Running a command in every submodule in a repository

In this chapter, you’ll learn how to maintain dependencies on other Git-based software projects within your own using Git submodules.

8.1. When are submodules useful?

Almost all software projects use other software projects as libraries or tools. For example, say you’re using Git and writing a desktop application in C++, and you want to communicate with a server that provides a JSON API. Rather than writing the JSON-handling code yourself, you ...

Get Git in Practice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.