squash

Consolidate commits on the current branch into a single Conventional Commits message.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/KosmoCHE/claude-plugins --skill squash-kosmoche
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: squash
Source: https://github.com/KosmoCHE/claude-plugins/tree/main/git-command/skills/squash
Command: npx skills add https://github.com/KosmoCHE/claude-plugins --skill squash-kosmoche

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Squashing multiple commits on the current branch into a single commit helps maintain a tidy project history, simplifies code reviews, and makes reverts easier.

Core Features & Use Cases

  • Soft reset to the merge-base and replay changes into a single commit on the current branch.
  • Optional scope control by limiting to the last N commits when provided.
  • Create a single, conventional-commits-formatted commit message for consistency.

Quick Start

Squash the last N commits on the current branch into a single conventional commit.

Frequently Asked Questions about squash

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

FAQPage Schema
How do I squash commits on a feature branch before merging to main?▼

To squash commits before merging, the process calculates the merge-base with your main branch, performs a soft reset to that point, and replays all branch changes into a single commit. This keeps your project history tidy and simplifies code reviews.

What is the best way to consolidate multiple git commits into one conventional commit?▼

Consolidating multiple commits into one conventional commit is done by soft resetting to the merge-base and creating a new commit message formatted to the Conventional Commits specification, ensuring a clean and consistent project history.

Can I limit the squash scope to only the last N commits on my branch?▼

Yes, you can limit the squash scope to the last N commits. By providing an optional scope control parameter, the commit consolidation restricts its range, allowing you to squash exactly the desired number of recent commits.

Does squashing with a soft reset preserve my working directory changes?▼

Squashing with a soft reset preserves your working directory changes because it moves the branch pointer to the merge-base without altering your files. All changes are then replayed into a single new commit, ensuring no work is lost.

Why should I squash feature commits before merging to main?▼

You should squash feature commits before merging to main because it helps maintain a tidy project history, simplifies code reviews by presenting changes coherently, and makes reverts easier if a bug is introduced.