Git Submodule Fork Reconfigure

Fork submodules and reconfigure remotes to regain write access.

1|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/Baneeishaque/ai-suite --skill git-submodule-fork-reconfigure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git Submodule Fork Reconfigure
Source: https://github.com/Baneeishaque/ai-suite/tree/main/.agents/skills/git_submodule_fork_reconfigure
Command: npx skills add https://github.com/Baneeishaque/ai-suite --skill git-submodule-fork-reconfigure

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Fork submodules on the fly and reconfigure remotes to regain write access when pushes fail due to permissions.

Core Features & Use Cases

  • Forking Upstream: Create a personal fork of the submodule to gain write access while preserving the upstream as a reference.
  • Remote Reconfiguration: Rename origin to upstream and add a new origin pointing to your fork, then push with tracking.
  • Parent Repo Alignment: Update .gitmodules and sync submodules to reflect the new fork.

Quick Start

Run the workflow to fork the upstream and reconfigure remotes to point submodules to your personal fork.

Frequently Asked Questions about Git Submodule Fork Reconfigure

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

FAQPage Schema
Why do my git submodule pushes fail with a 403 permission denied error?

Git submodule pushes fail with a 403 permission denied error when you lack write access to the upstream repository. You can resolve this by forking the upstream submodule and reconfiguring your remotes to point to your personal fork.

How do I fork a git submodule and reconfigure remotes to regain write access?

To fork a git submodule and regain write access, fork the upstream repository via gh, rename the original origin to upstream, add your fork as the new origin, and push with tracking to update the remote configuration.

Does forking a submodule remove the original upstream repository reference?

Forking a submodule does not remove the original upstream repository reference. The process renames the original origin to upstream, preserving it as a reference while adding your new fork as the primary origin for write operations.

How do I update the parent repository after reconfiguring submodule remotes?

To update the parent repository after reconfiguring submodule remotes, modify the .gitmodules file to reflect the new fork URL and run git submodule sync to align the local configuration with the updated remote endpoints.

What is the best way to fix git submodule permission issues across multiple repositories?

The best way to fix git submodule permission issues across repositories is to systematically fork each upstream submodule, re-point the remotes to your personal forks, and update the parent repository alignment through .gitmodules and submodule sync.

Do I need the GitHub CLI installed to fork submodules and reconfigure remotes?

You need the GitHub CLI installed because the fork creation process utilizes gh to generate your personal copy of the upstream submodule before renaming and adding the new remotes for tracking and pushing.