Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Clean Up Your Commit History Effortlessly with Git Fixups

May 27, 2026

We've all been there: you submit a pull request, notice a tiny typo, and end up making a commit named "fix typo" or "temp." Instead of cluttering your git history, try using `git commit --fixup [commit-hash]` when committing the fix. This marks your new change as a fixup of that specific older commit.

When you're ready to clean things up before merging, run `git rebase -i --autosquash origin/main`. Git will automatically organize your interactive rebase todo list, placing the fixup commits directly beneath their parent commits and marking them to be melted in. It keeps your commit history pristine without the manual drag-and-drop headache.