git-squash

Squash and organize branch commits into logical groups, then push with force-with-lease.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/mjun0812/skills --skill git-squash-mjun0812
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-squash
Source: https://github.com/mjun0812/skills/tree/main/skills/git/git-squash
Command: npx skills add https://github.com/mjun0812/skills --skill git-squash-mjun0812

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Feature branches often accumulate messy, incremental commits that clutter history before merging. This Skill automatically squashes and reorganizes the commits on the current branch into clean, Conventional Commits-formatted history without manual interactive rebase work. ## Core Features & Use Cases - Automatic Logical Grouping: Groups commits by type, changed files, and PR context, or squashes everything into one commit with the --one flag. - Safe Execution: Aborts automatically on the default branch, uncommitted changes, missing upstream commits, or force-with-lease failures, never falling back to --force. - Dry-Run and Language Support: Preview the grouping plan and generated commit messages with --dry-run, and produce commit messages and reports in a specified language. - Use Case: Before merging a feature branch with 12 WIP commits, run this Skill to condense them into 3 well-structured Conventional Commits and push with --force-with-lease. ## Quick Start Squash and tidy the commits on my current branch, then push with force-with-lease.

Frequently Asked Questions about git-squash

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

FAQPage Schema
How do I squash commits on the current Git branch automatically?

Invoke the skill on your feature branch and it resets softly to the base branch, regroups changes into logical Conventional Commits, and pushes with force-with-lease. Use the --one flag to collapse everything into a single commit.

How to preview a commit squash plan before rewriting history?

Pass the --dry-run flag to see the proposed grouping and new commit messages without performing any reset, commit, or push. This lets you review the plan before any history is rewritten.

Can I squash commits without pushing to the remote?

Yes, use the --no-push flag to perform the squash locally only. The skill then reports the exact push command you can run manually when ready.

Why does git squash abort with uncommitted changes?

The skill refuses to run when the working tree has uncommitted modifications to prevent accidental data loss. Commit or stash your changes manually first, since the skill never stashes or commits automatically.

Is force push safe when squashing branch commits?

The skill only uses git push --force-with-lease, which fails if the remote has commits you have not fetched. It never falls back to plain --force, and it aborts if the upstream contains unpulled commits.