DEV Community

Toolloom
Toolloom

Posted on • Originally published at toolloom.com on

Mastering the Art of Clean History with Git Squash

Ever look back at your commit history and see a dozen messages like "fix," "typo," or "actually fixing it now"? It happens to the best of us during a long coding session. Before you open that PR, try using an interactive rebase to squash those tiny, messy commits into one cohesive feature commit. Using git rebase -i HEAD~n allows you to pick and choose which commits to combine. It keeps the main branch history readable and makes it much easier for your teammates to see the actual logic changes without the noise of your incremental saves.

Top comments (0)