Rewrite Git history
Rewrite Git history with interactive rebase or git filter-repo. Covers squashing, removing files, rewording messages, and safely force-pushing to the remote.
Preview
Copy prompt
I need to rewrite the Git history of [Repository] to [Remove a sensitive file / Squash a range of commits / Reword past commit messages / Split a large commit into logical parts]. Provide the exact sequence of git commands using interactive rebase or git filter-repo as appropriate. Include clear warnings about why history rewriting is dangerous on shared branches, what happens to open pull requests, and the precise steps to safely force-push the rewritten history to the remote while notifying collaborators to re-sync their local clones.
More
Git & Version Control
Prompts
