11 commits including 'WIP', 'fix typo', 'actually fix it'. Tech lead won't approve.
Squash 11 messy commits into 3 clean ones.
Medium · 4 steps · +500 XP
This scenario walks through 4 steps, in order:
Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.
git log --onelinegit rebase -i HEAD~11git push --force-with-leasegit log --oneline11 → 3 clean commits. Many teams enforce squash-merge automatically.