squash-commits

Consolidate all Git branch commits into a single commit with a synthesized message.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/bkowshik/agent-skills --skill squash-commits-bkowshik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: squash-commits
Source: https://github.com/bkowshik/agent-skills/tree/main/skills/squash-commits
Command: npx skills add https://github.com/bkowshik/agent-skills --skill squash-commits-bkowshik

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines your Git workflow by consolidating multiple small commits into a single, coherent commit, making your branch history cleaner and easier for reviewers to understand.

Core Features & Use Cases

  • Consolidate Commits: Combines all commits on your current branch into one.
  • Synthesize Commit Message: Generates a meaningful commit message from the originals.
  • Preserve History: Creates a backup of your original commits for easy recovery.
  • Use Case: After a long development cycle with many intermediate "WIP" or "fix" commits, use this Skill to present a single, polished commit representing the final changes before merging into the main branch.

Quick Start

Ask your AI coding tool to squash all commits on this branch into one.

Frequently Asked Questions about squash-commits

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

FAQPage Schema
How do I squash all commits on a Git branch into a single commit?

Squashing commits on a Git branch involves consolidating all intermediate commits into a single commit with a synthesized message. This skill automates soft-reset operations, base branch detection, and pre-flight checks to clean up branch history before merging.

What is the best way to clean up Git history before merging a branch?

Cleaning up Git history before merging is best achieved by squashing multiple WIP or fix commits into a single, coherent commit. This skill synthesizes a meaningful commit message from the originals to present a polished branch history for code review.

Can I recover my original Git commits after squashing them?

Yes, you can recover original Git commits after squashing because this skill creates a backup of your original branch history. This ensures your previous intermediate commits are preserved for easy recovery during the soft-reset process.

Does this Git squashing process work on macOS and Linux?

Yes, this Git squashing process works on macOS and Linux environments. It requires Git version 2.20 or higher to properly execute the soft-reset operations and base branch detection needed for consolidating branch history.

How does a synthesized commit message work when squashing branch history?

A synthesized commit message is automatically generated from your original intermediate commits when squashing branch history. This creates a meaningful, single commit message that accurately represents the final changes for reviewers before merging into the main branch.