Git Squash

Squash multiple Git commits into one non-interactively.

1|1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/dtsong/claude-code-windows-setup --skill git-squash-dtsong
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git Squash
Source: https://github.com/dtsong/claude-code-windows-setup/tree/main/skills/git-workflows/skills/squash
Command: npx skills add https://github.com/dtsong/claude-code-windows-setup --skill git-squash-dtsong

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the process of cleaning up your Git commit history by combining multiple smaller commits into fewer, more meaningful ones, making your project's history easier to understand and manage.

Core Features & Use Cases

  • Non-interactive squashing: Combines commits without requiring manual intervention in an editor.
  • Flexible targeting: Allows squashing a specific number of recent commits, or all commits since a particular branch.
  • Use Case: Before submitting a pull request, you can use this skill to squash several "WIP" or "fix typo" commits into a single, descriptive commit that accurately reflects the feature or fix.

Quick Start

Use the git squash skill to squash the last 3 commits.

Frequently Asked Questions about Git Squash

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

FAQPage Schema
How do I squash multiple git commits into one before a pull request?

To squash multiple git commits into one, this Skill non-interactively combines recent commits into a single, cleaner commit. It prepares your project history for pull requests by merging smaller commits without requiring manual editor intervention.

What is the best way to clean up WIP and fix typo commits in my Git history?

Cleaning up WIP and fix typo commits in your Git history is done by squashing them into a single, descriptive commit. This creates a more meaningful and organized version control record for your project.

Can I squash all commits since a specific branch without using an interactive rebase editor?

You can squash all commits since a specific branch non-interactively. This Skill supports flexible targeting to combine commits since a given branch, bypassing the need for manual interactive rebase editor sessions.

How do I preview changes and generate a combined commit message when squashing commits?

Previewing changes and generating a combined commit message when squashing commits is supported directly. The Skill offers options to preview the squashed changes and automatically generate a combined message for the new commit.

Does squashing a specific number of recent commits work for organizing GitHub version control?

Squashing a specific number of recent commits works effectively for organizing GitHub version control. You can target an exact number of recent commits to merge, ensuring a cleaner project history before submission.

When should I avoid squashing my git commit history?

You should avoid squashing your git commit history when you need to preserve the detailed, incremental context of individual commits. Squashing permanently combines these separate commits into a single record, losing granular tracking.