git-submodule-commit

Commit and push git submodule changes and update the parent repository reference.

Updated Feb 15, 2026
One-click install
npx skills add https://github.com/glhewett/public-skills --skill git-submodule-commit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-submodule-commit
Source: https://github.com/glhewett/public-skills/tree/main/git-submodule-commit
Command: npx skills add https://github.com/glhewett/public-skills --skill git-submodule-commit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the multi-step process of committing changes inside a git submodule and updating the parent repository to reference the new submodule commit, preventing mismatched refs and manual git errors.

Core Features & Use Cases

  • Submodule validation: Verifies the provided path is defined in .gitmodules before taking action.
  • Review before commit: Shows status and diffs for user inspection prior to staging and committing.
  • End-to-end update: Commits and pushes within the submodule, then stages and commits the updated submodule SHA in the parent repository and pushes the parent.
  • Use Case: Update a skills submodule (default .claude/skills) with local fixes, push the submodule remote, and make a single parent commit that points to the new submodule SHA.

Quick Start

Commit and push changes in .claude/skills and update the parent repository reference.

Frequently Asked Questions about git-submodule-commit

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

FAQPage Schema
How do I commit changes in a git submodule and update the parent repository?

To commit a git submodule and update the parent repository, you must stage and commit changes inside the submodule, push to its remote, then stage the new submodule SHA in the parent repo and push the parent. This ensures collaborators and CI pull the correct submodule state.

Why does my parent repository show a dirty submodule after committing changes inside it?

A parent repository shows a dirty submodule after an internal commit because the parent tracks a specific submodule SHA. You must stage the updated submodule path in the parent repository and commit the new reference to resolve the mismatch.

What is the best way to automate pushing a git submodule and its parent repo together?

Automating a git submodule push and parent update requires validating the submodule path, showing diffs, committing and pushing the submodule, then staging and committing the updated SHA in the parent before pushing the parent repository to keep refs synchronized.

Do I need to configure remote credentials separately to push git submodules?

Yes, you need git and remote credentials configured for both the submodule and the parent repository. This allows the process to successfully push the submodule commit and subsequently push the updated parent repository reference.

How does a submodule path validation check work before committing changes?

Submodule path validation verifies the provided directory against the .gitmodules file before taking action. This ensures the target is a registered submodule, preventing manual git errors and mismatched refs during the commit and push process.

Can I review changes before a submodule is committed and pushed?

Yes, the process shows status and diffs for user inspection prior to staging and committing. This allows you to review submodule changes end-to-end before the parent repository records the new submodule commit.