squash
Installation
SKILL.md
Git Squash
Pre-flight Checks
Before merging, validate the environment:
- Determine source branch — use the argument if provided (
/squash feature/my-branch), otherwise use the current branch. - Verify not on main — abort if source branch is
main. - Check for uncommitted changes —
git status --porcelain. If dirty, abort and suggest committing or stashing. - Verify branch exists —
git rev-parse --verify <branch>. - Verify divergence —
git log main..<branch> --oneline. If empty, abort — nothing to merge.
Switch to Main
git checkout main
If remote origin exists, pull latest with git pull --ff-only. If ff-only fails, abort — main has diverged and needs manual resolution.