sync-submodules

Synchronize Git submodules to pinned commits with optional stashing.

63|8|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/different-ai/the-factory --skill sync-submodules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-submodules
Source: https://github.com/different-ai/the-factory/tree/main/.opencode/skills/sync-submodules
Command: npx skills add https://github.com/different-ai/the-factory --skill sync-submodules

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill ensures that your project's submodules are consistently updated to the versions pinned by the main repository, preventing common Git errors and keeping your development environment stable.

Core Features & Use Cases

  • Safe Submodule Updates: Pulls changes for the main repository and updates all submodules to their designated commits.
  • Handles Dirty Submodules: Automatically stashes local changes within submodules if the STASH_DIRTY environment variable is set, preventing data loss during updates.
  • Error Resolution: Provides guidance and commands to resolve common submodule update issues like "local changes would be overwritten" or "not our ref".
  • Use Case: When you clone a project with submodules or encounter errors during a git submodule update, this Skill can safely bring all your dependencies in line with the project's requirements.

Quick Start

Run the sync-submodules skill to update all git submodules for the current repository.

Frequently Asked Questions about sync-submodules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely update git submodules to the commits pinned by the main repository?

To safely update git submodules, pull the main repository changes and run a submodule synchronization to update all dependencies to their designated pinned commits without losing local data.

What's the best way to handle dirty git submodules during a sync update?

Handling dirty git submodules during a sync requires setting the STASH_DIRTY environment variable, which automatically stashes local changes within the submodules to prevent data loss during the update.

Why does git submodule update fail with local changes would be overwritten?

Git submodule updates fail with local changes overwrite errors when uncommitted modifications exist in the submodule directory, requiring you to stash or commit changes before synchronizing dependencies.

How do I resolve common git submodule errors like not our ref during updates?

Resolving git submodule errors like not our ref involves executing specific Git commands provided by the synchronization workflow to clear invalid references and restore the correct pinned commits.

Do I need to manually stash changes in submodules before pulling a monorepo?

You do not need to manually stash submodule changes before pulling a monorepo if the automated workflow is configured to handle dirty submodules via environment variable flags for safe dependency updates.