git-github-history-rewrite

Rewrite Git commit history using interactive rebase and git-filter-repo.

1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/FutureAtoms/claude-skills-backup --skill git-github-history-rewrite
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-github-history-rewrite
Source: https://github.com/FutureAtoms/claude-skills-backup/tree/main/git-github-history-rewrite
Command: npx skills add https://github.com/FutureAtoms/claude-skills-backup --skill git-github-history-rewrite

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and tools to safely and effectively rewrite Git history, preventing data loss and ensuring collaboration best practices.

Core Features & Use Cases

  • Interactive Rebase: Learn to reorder, squash, edit, or drop commits.
  • Amend Commits: Easily modify the last commit or older ones.
  • Filter-repo: Powerful tool for large-scale history rewriting (e.g., removing sensitive data, changing authors).
  • Safety First: Emphasizes critical rules like avoiding shared branches and creating backups.
  • Use Case: You accidentally committed a sensitive API key to your feature branch. Use this Skill to remove it from history before merging.

Quick Start

Use the git-github-history-rewrite skill to safely rewrite the last 5 commits on your current branch.

Frequently Asked Questions about git-github-history-rewrite

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

FAQPage Schema
How do I remove sensitive data from Git history?

To remove sensitive data from Git history, you can use git-filter-repo for large-scale rewriting or interactive rebase to drop specific commits. Always create a backup branch first to ensure data recovery if mistakes occur during the rewriting process.

What is the best way to rewrite Git commit messages on older commits?

The best way to rewrite Git commit messages on older commits is using interactive rebase. This allows you to select the target commits and change their messages safely, provided you avoid rewriting history on shared branches.

Can I change author information across my entire Git repository?

Yes, you can change author information across your entire Git repository by using git-filter-repo. This tool is designed for large-scale history rewrites, allowing you to update author details while maintaining commit integrity.

Does git-filter-repo work for reordering and squashing commits?

For reordering and squashing commits, interactive rebase is the recommended approach. git-filter-repo is intended for broad repository changes like removing sensitive data, while interactive rebase handles precise commit manipulation.

When should I not rewrite Git history on shared branches?

You should never rewrite Git history on shared branches because it disrupts collaboration and causes merge conflicts for other contributors. Always restrict history rewriting to local feature branches and force-push only when absolutely necessary.

How do I recover lost commits after a Git history rewrite?

To recover lost commits after a Git history rewrite, use the Git reflog to find the previous commit hashes and reset your branch to the original state. Creating a backup branch before rewriting ensures you have a reliable recovery point.