git-rewrite-history

Rewrite Git history safely using git-filter-repo.

101|2|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/cowwoc/cat --skill git-rewrite-history-cowwoc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-rewrite-history
Source: https://github.com/cowwoc/cat/tree/main/plugin/skills/git-rewrite-history
Command: npx skills add https://github.com/cowwoc/cat --skill git-rewrite-history-cowwoc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rewriting Git history is risky when using legacy tools. This Skill promotes using git-filter-repo as a safer, recoverable approach to history rewriting.

Core Features & Use Cases

  • Safe history rewrites using git-filter-repo
  • Backup-Verify-Cleanup workflow to protect data and enable recovery
  • Use cases include removing secrets, pruning large files, and reorganizing history across repositories

Quick Start

Start by installing git-filter-repo if needed, clone a fresh repository, create a backup, run the rewrite with the partial reflog option, verify results, and push only after explicit approval.

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 to remove secrets from a repository?

You can prune large files from git history by rewriting it with git-filter-repo. This modern tool provides a recoverable approach to remove unwanted files while preserving the rest of your repository's history.

What is the best way to rewrite git history without losing data?

Yes, git-filter-repo supports reorganizing history across multiple repositories. It allows you to safely rewrite and restructure your commit history while maintaining a recoverable backup during the transition.

Do I need to backup my repository before rewriting git history?

Yes, you need to clone a fresh repository and create a backup before rewriting git history. This preparatory step ensures your data remains recoverable if the git-filter-repo operation produces unexpected results.

What are the limitations of using git-filter-repo to rewrite history?

A key limitation is that rewriting git history changes commit hashes, requiring collaborators to reset their local branches. You must verify results locally and only push after explicit approval to avoid corrupting shared history.