git-advanced

Guide interactive rebases, commit surgery, and history manipulation in Git.

8|2|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/geoffjay/claude-plugins --skill git-advanced-geoffjay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-advanced
Source: https://github.com/geoffjay/claude-plugins/tree/main/plugins/utilities/git/skills/git-advanced
Command: npx skills add https://github.com/geoffjay/claude-plugins --skill git-advanced-geoffjay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bfg, and includes assets (resource) and references (resource) components.

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.

Frequently Asked Questions about git-advanced

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

FAQPage Schema
How do I clean up my git history before merging a feature branch?

Interactive rebase lets you squash, reorder, and edit commits in your branch history. Run `git rebase -i HEAD~N` (where N is the number of commits), then mark commits as 'squash', 'reword', or 'edit' in the editor. This creates a clean, logical commit graph before merging into main.

Can I combine multiple commits into one with git rebase?

Yes, interactive rebase squashes commits by marking them 'squash' or 's' in the rebase editor. All marked commits fold into the previous commit, and you write a single combined message. This consolidates small fixes or work-in-progress commits into logical units.

What's the best way to fix an old commit message without rewriting the entire branch?

Use interactive rebase: run `git rebase -i HEAD~N`, mark the target commit as 'reword' or 'r', and edit the message when prompted. This fixes the message while preserving all subsequent commits, avoiding unnecessary history rewrites on shared branches.

How do I resolve merge conflicts during a complex rebase?

Git pauses the rebase at conflicted commits. Edit files to resolve conflicts, stage changes with `git add`, then continue with `git rebase --continue`. For catastrophic conflicts, use `git rebase --abort` to restart. The Skill provides conflict resolution strategies and merge tools for precise integration.

Can I remove a file from git history permanently?

Yes, using BFG or `git filter-repo`, both commit-surgery tools that rewrite history to expunge files. BFG is faster for large repos; `git filter-repo` offers finer control. Both regenerate commits and refs, completely removing the file from all historical snapshots.

When should I use cherry-pick instead of merge for integrating commits?

Cherry-pick copies specific commits onto your current branch, ideal when you need selective commits from another branch without merging its full history. Merge integrates entire branches; cherry-pick is precise but creates new commits. Use cherry-pick for surgical code integration across unrelated branches.