Doing It Wrong

learn in public

Site Navigation

  • Home
  • Books
  • Work & Play

Site Search

You are here: Home / Development / Git Submodules

Git Submodules

posted on November 27, 2023

Oft-used, never understood.

References

  • Git SCM
  • man git-submodule

Add a Submodule

git submodule add <URL>

This creates a .gitmodules file that shows the mapping between your project and its submodules.

Clone with Submodules

  1. clone your project as normal
  2. git submodule init to initialize from .gitmodules
  3. git submodule update to fetch data from the commit referenced at the other end of the .gitmodules repo URL

Filed Under: Development Tagged With: git

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Profile Links

  • GitHub
  • Buy Me a Coffee?

Recent Posts

  • Event Listeners
  • A Philosophy of Software Design
  • The Programmer’s Brain
  • Thoughts on Microservices
  • API Design Patterns

Recent Comments

No comments to show.

Archives

  • May 2025
  • September 2024
  • July 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • December 2022
  • December 2021

Categories

  • Development