git-submodule

Installation
Summary

Version-control external repositories within a main project using Git submodules.

  • Add, update, and remove submodules with commands for locking specific commits, branches, or tags
  • Clone repositories with submodules using --recursive or manual initialization and update steps
  • Batch operations across all submodules via git submodule foreach for pulling, checking status, and branch management
  • Nested submodule support with recursive initialization and updates for complex dependency hierarchies
  • Troubleshooting guidance for detached HEAD states, permission errors, dirty submodules, and reference mismatches
SKILL.md

Git Submodule

When to use this skill

  • Including external Git repositories within your main project
  • Managing shared libraries or modules across multiple projects
  • Locking external dependencies to specific versions
  • Working with monorepo-style architectures with independent components
  • Cloning repositories that contain submodules
  • Updating submodules to newer versions
  • Removing submodules from a project

Instructions

Step 1: Understanding submodules

Git submodule is a feature for including other Git repositories within a main Git repository.

Key concepts:

Related skills

More from supercent-io/skills-template

Installs
10.4K
GitHub Stars
88
First Seen
Jan 24, 2026