Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Tidy up your history with Git Squash

March 11, 2026

Ever look back at your branch history and see ten "fix typo" or "wip" commits? It happens to the best of us! Before you open that pull request, try using git rebase -i HEAD~n (where n is the number of commits) to squash those tiny updates into one meaningful commit. Your teammates will thank you for the clean, readable history, and it makes reverting changes much easier if something goes wrong later.

Just remember to only squash on your local branch before pushing to a shared repository to avoid rewriting history for others. It keeps the project timeline professional and highlights the actual logic changes rather than the minor stumbles along the way.