Agent skill · software engineering · aiskillstore
git-submodule
Manage Git submodules for including external repositories within a main repository. Use when working with external libraries, shared modules, or managing dependencies as separate Git repositories.
Why this skill is useful
Provides specific commands and workflows for managing Git submodules that the AI wouldn't reliably generate on its own.
What it needs
About 6k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
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: Submodules lock version by referencing a specific commit Submodule paths and URLs are recorded in the .gitmodules file Changes within a submodule are managed as separate commits Step 2: Adding submodules Basic addition: Track a specific branch: Commit after adding: Step 3: Cloning with submodules When cloning fresh: Initialize and update in one line: Step 4: Updating submodules Update to latest remote version: Checkout to the referenced commit: Step 5: Working inside submodules Working inside a submodule: Reflect submodule changes in main repository: Step 6: Batch operations Run commands on all submodules: Step 7: Removing submodules Completely remove a submodule: Example: Remove libs/lib: Step 8: Checking submodule status Check status: Interpreting output: Examples Example 1: Adding an External Library to a Project Example 2: Setup After Cloning a Repository with Submodules Example 3: Updating Submodules to the Latest Version Example 4: Using Shared Components Across Multiple Projects Example 5: Handling Submodules in CI/CD Advanced workflows Nested Submodules Changing Submodule URL Converting a Submodule to a Regular Directory Saving Space with Shallow Clones Best practices 1. Version locking: Always lock submodules to a specific commit/tag for reproducibility 2. Documentation: Specify submodule initialization steps in README 3. CI configuration: Use --recursive option in CI/CD pipelines 4. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/git-submodule