Mid From PDF Version Control Git & GitHub

What are submodules in Git, and when would you use them?

A Git submodule is a repository inside another repository — useful for including shared

components or libraries.

Example:

You have multiple microservices that share a common authentication library. Instead of

duplicating it, you include it as a submodule:

git submodule add

libs/auth

Pros: Keeps shared code centralized.

Cons: Requires careful syncing; new contributors must initialize submodules using:

git submodule update --init --recursive

More from Developer Essentials

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details