clean-branch-history

Reorganize feature branch commits into coherent units before merging.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/seankao31/dotfiles --skill clean-branch-history
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-branch-history
Source: https://github.com/seankao31/dotfiles/tree/main/agent-config/skills/clean-branch-history
Command: npx skills add https://github.com/seankao31/dotfiles --skill clean-branch-history

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reorganizes a development branch's commits into clean, logical units before merging. This minimizes noise from fixups, revert commits, and review-driven changes, helping reviewers focus on substantive changes.

Core Features & Use Cases

  • Automatically folds related fixes into their respective commits to produce a coherent history
  • Preserves code changes while eliminating nonessential noise, avoiding history drift
  • Safety-first workflow: creates a pre-cleanup tag, verifies tree integrity before and after, and provides rollback guidance

Quick Start

Invoke this skill during the code review preparation phase on a feature branch to begin organizing commits into coherent units.

Frequently Asked Questions about clean-branch-history

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

FAQPage Schema
How do I clean up git commit history before a code review?

Cleaning up git commit history involves reorganizing a feature branch's commits into logical units before merging. This process folds fixups and revert commits into coherent history, minimizing noise so reviewers can focus on substantive changes.

What is the safest way to rebase a feature branch without losing changes?

Safe rebasing involves creating a pre-cleanup tag and verifying tree-hash equivalence before and after the rebase. This ensures code changes are preserved while eliminating nonessential noise, avoiding history drift.

How do I squash fixup commits automatically during an interactive rebase?

Squashing fixup commits automatically is possible by guiding an interactive rebase through a scripted GIT_SEQUENCE_EDITOR. This folds related fixes into their respective commits to produce a coherent history.

When should I reorganize commits on a development branch?

Reorganize commits during the code review preparation phase on a feature branch. This transforms a noisy history into coherent, reviewable commits before merging, minimizing noise from review-driven changes.

How do I rollback a git rebase if the tree hash changes?

If the tree hash changes after a rebase, rollback using the pre-cleanup tag created before the process began. The workflow demands tree-hash equivalence and provides rollback guidance to restore the branch.