DEV Community

Toolloom
Toolloom

Posted on • Originally published at toolloom.com on

Squashing Commits Locally Before the Push

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.

Top comments (0)