Cheatsheet Pages / Git Cheatsheet

How to squash or reword recent commits — git rebase -i

Your last few commits are a mess of fixups and you want them cleaned up before opening a pull request.

git rebase -i HEAD~3   # opens an editor: pick / squash / reword / drop

Good to know

Squash, reorder, reword, or drop your last few commits before sharing. Same golden rule as any rebase: only rewrite commits nobody else has pulled.

Git Cheatsheet one-page card — 30 daily and rescue commands
The full one-page card — Git Cheatsheet. Get the complete cheatsheet on GitHub