Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Keep your Git history clean with squashing
March 29, 2026
Ever look back at a pull request and see ten commits titled "fix typo" or "trying again"? It happens to the best of us, but you can keep your main branch pristine by using an interactive rebase. Running git rebase -i HEAD~n lets you "squash" those tiny, messy commits into one meaningful feature commit before you merge.
It makes life much easier for your teammates (and your future self) when you're trying to figure out why a specific change was made months down the line. Clean history makes debugging with git bisect a total breeze.