git-rewrite-history

Rewrites git history with mandatory dry-run planning and user confirmation.

31|6|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/WaterplanAI/agentic-config --skill git-rewrite-history-waterplanai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-rewrite-history
Source: https://github.com/WaterplanAI/agentic-config/tree/main/core/skills/git-rewrite-history
Command: npx skills add https://github.com/WaterplanAI/agentic-config --skill git-rewrite-history-waterplanai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rewriting Git history is error-prone and potentially destructive. This Skill provides a safe, auditable workflow with mandatory dry-run planning and explicit user confirmation to prevent data loss.

Core Features & Use Cases

  • Dry-run plan that outlines all changes before any operation.
  • Backup creation before any rebase, amend, or tag operations to preserve history.
  • Supports amend, squash, reword, and tag updates across branches for history cleanup in both solo and collaborative projects.
  • Prompts for confirmation before executing destructive steps, ensuring safe rollout.

Quick Start

Use this Skill to rewrite the last 3 commits on the current branch with a dry-run plan first, then apply changes after you approve.

Frequently Asked Questions about git-rewrite-history

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

FAQPage Schema
How do I safely rewrite Git history without losing commits?

Rewriting Git history safely requires a dry-run plan before execution. This Skill creates a mandatory backup, outlines all changes in advance, and prompts for confirmation before applying destructive operations like rebasing, amending, or squashing commits.

Can I amend, squash, or reword multiple commits at once?

Yes. This Skill supports amending, squashing, rewording, and tag updates across multiple commits in a single workflow. It applies to both solo and collaborative projects, with dry-run planning and backup creation before any changes take effect.

What happens if a rebase or history rewrite goes wrong?

A backup is automatically created before any destructive operation. If something fails, you can restore from the backup. The dry-run plan also lets you review all changes before confirming execution.

Do I need to manually back up my repository before rewriting history?

No. This Skill automatically creates a backup before rebase, amend, or tag operations. You review the dry-run plan, approve the changes, and the backup is preserved in case rollback is needed.

Can I update or preserve tag messages when rewriting history?

Yes. This Skill supports tag updates and preserves tag messages during history rewrites, ensuring metadata is maintained across amend, squash, and reword operations on tagged commits.

Does this work with collaborative Git workflows or only solo projects?

It works with both solo and collaborative workflows. The Skill applies to local repositories and enforces safe practices through dry-run planning and user confirmation, making it suitable for team environments where history changes need audit trails.