clean-commit-history
Installation
SKILL.md
Clean up the current branch's commit history by incorporating uncommitted changes into the correct recent commits.
Procedure
1. Assess current state
- Run
git statusto check for uncommitted changes (staged + unstaged + untracked). - If there are NO uncommitted changes, stop and inform the user.
- Run
git log --oneline <base-branch>..HEADto see the branch's commits (detect base branch from tracking info or the repository's default branch, e.g.mainormaster). - If there is only one commit on the branch, there is nothing to fixup into — just amend that commit with the pending changes and force-push.