Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Squashing Commits Locally Before the Push

February 8, 2026

If you've been working on a feature branch and have 15 commits like 'fix typo,' 'oops forgot a semicolon,' and 'actual feature implementation,' your history is messy. Before merging or submitting a PR, clean it up! Use `git rebase -i HEAD~X` (where X is the number of commits to review). This opens an interactive editor where you can 'squash' those tiny, incremental saves into one clean, meaningful commit, making your project history much more readable for everyone else.