rewrite-history

Rewrite git branch history while preserving the final tree state.

Updated Nov 26, 2025
One-click install
npx skills add https://github.com/Aias/dotfiles --skill rewrite-history
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rewrite-history
Source: https://github.com/Aias/dotfiles/tree/main/agents/skills/rewrite-history
Command: npx skills add https://github.com/Aias/dotfiles --skill rewrite-history

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rewriting git history to produce a cleaner, more understandable commit narrative without changing the resulting project state.

Core Features & Use Cases

  • Base-branch detection and safety checks to guard against unsafe rewrites.
  • Stepwise planning that transforms the commit history into a minimal, coherent sequence.
  • Safe, auditable workflow that verifies the tree is byte-for-byte identical to the original.

Quick Start

Choose the base branch and run the rewrite workflow to produce a clean, identical final tree.

Frequently Asked Questions about rewrite-history

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

FAQPage Schema
How do I safely rewrite git history without changing the final project state?

To safely rewrite git history, apply a workflow that enforces precheck steps and base-branch detection, then performs a final byte-for-byte verification of the tree to ensure the rewritten history matches the original content exactly.

What is the best way to squash and reword commits before a force-push?

Squashing and rewording commits before a force-push is best handled by a stepwise planning workflow that transforms the commit history into a minimal, coherent sequence while preserving the final tree state.

How can I reorder git commits to create a cleaner narrative for code review?

Reordering git commits for a cleaner narrative involves transforming the commit history into a minimal, coherent sequence, ensuring the rewritten history remains byte-for-byte identical to the original tree.

Does rewriting git branch history support base-branch detection for safety checks?

Rewriting git branch history includes base-branch detection and safety checks to guard against unsafe rewrites, ensuring destructive history changes do not compromise the original project state.

When should I not use destructive git history rewriting on my current branch?

You should avoid destructive git history rewriting when precheck steps or base-branch detection fail, as these safety mechanisms exist to prevent unsafe rewrites that could alter the final tree state.