What problem does it solve?
Experienced Git users often need to perform complex operations like rewriting history, splitting/squashing commits, or advanced merging, which can be daunting and risky without precise instructions. This Skill empowers you to confidently manipulate your repository history.
Core Features & Use Cases
- Interactive Rebase: Strategies for squashing, reordering, splitting, and editing commits in history to maintain a clean and logical commit graph.
- Commit Surgery: Techniques for amending commits, changing authors, and removing files from history using powerful tools like
git filter-repo or BFG.
- Advanced Merging & Cherry-Picking: In-depth guidance on various merge strategies, conflict resolution tools, and cherry-picking merge commits for precise code integration.
- Use Case: A developer needs to clean up a feature branch before merging it into
main, combining several small commits into logical units and fixing an old commit message. This Skill provides the exact interactive rebase commands and workflow to achieve a clean, linear history.
Quick Start
Start an interactive rebase for the last 5 commits
git rebase -i HEAD~5
In the editor, mark commits with 'squash', 'reword', 'edit', or 'drop'.
Example: Squash last 2 commits into the first
pick abc123 feat: initial feature
squash def456 fix: minor bug
squash ghi789 style: formatting
After saving, Git will prompt for a new commit message.