non-interactive-git-rebase
Installation
SKILL.md
Non-Interactive Git Rebase
Overview
git rebase -i normally opens an editor for the todo list. By setting GIT_SEQUENCE_EDITOR to a command that replaces the todo file with a pre-prepared one, you can perform any interactive rebase operation — reorder, drop, squash, edit, amend — entirely from scripts.
CRITICAL: Always Create a Backup Branch
Before any rebase, create a backup branch:
git branch backup-before-rebase HEAD
After the rebase succeeds and verification passes, do NOT delete the backup branch automatically. Always ask the user before deleting it, unless the user explicitly requested automatic cleanup. The backup is cheap to keep and the user may discover problems later.
Core Technique
How GIT_SEQUENCE_EDITOR Works
Related skills