with one click
squash-commits
// Reorganize messy branch commits into a small set of logical, meaningful commits without changing any content. Drops merge-from-main commits. Safe: creates a backup branch first.
// Reorganize messy branch commits into a small set of logical, meaningful commits without changing any content. Drops merge-from-main commits. Safe: creates a backup branch first.
Review, refactor, document, and validate code changes in the current branch
Create changelog files for important commits in a PR
Update documentation pages to match source code changes on the current branch
Document a Python module and its classes using Google style
| name | squash-commits |
| description | Reorganize messy branch commits into a small set of logical, meaningful commits without changing any content. Drops merge-from-main commits. Safe: creates a backup branch first. |
Reorganize the commits on the current branch into a small number of logical commits. Do NOT change any file content — only the commit structure changes.
git status --short
If there are uncommitted changes, stop and tell the user to commit or stash them first.
git log main..HEAD --oneline
git diff main..HEAD --name-only
List every file changed vs main and every commit on the branch (excluding merge commits from main).
git branch backup/<current-branch-name>
Tell the user the backup exists so they can recover if needed.
git reset --soft main
git restore --staged .
All branch changes are now in the working tree, unstaged. No content has changed.
Read the changed files and the original commit messages to understand what the work covers. Group related files into logical commits. Typical groups:
Use the changelog files (if any) as a strong hint — each changelog entry often maps to one commit.
Present the proposed grouping to the user and ask for confirmation before committing.
For each group, stage only the relevant files and commit with a clear message following the project's conventions:
git add <file1> <file2> ...
git commit -m "..."
Use conventional commit prefixes if the project uses them (feat:, fix:, refactor:, test:, chore:).
git log main..HEAD --oneline
git diff main..HEAD --name-only
git status --short
Confirm:
main is identical to beforeThe branch history has been rewritten. Tell the user they will need to git push --force-with-lease when they are ready to update the remote. Do NOT push automatically.
git reset --hard backup/<branch-name>.