Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Keeping Git History Clean with Fixup
March 31, 2026
We’ve all been there: you just pushed a PR and noticed a tiny typo. Instead of creating a messy "fix typo" commit, use git commit --fixup followed by the hash of the commit you want to patch. This marks the new changes to be merged into that specific previous commit.
When you're ready to clean up, run git rebase -i --autosquash. Git will automatically organize those tiny fixes into their parent commits, leaving you with a pristine, professional-looking history that your reviewers will appreciate.