Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

The Magic of Git Commit --amend

February 15, 2026

We've all been there: you hit enter on a commit only to realize you left a typo in a comment or forgot to add one tiny file. Instead of creating a "fix typo" commit that clutters your history, use `git commit --amend --no-edit`. This command tucks your staged changes into the previous commit without changing the message.

It keeps your PRs clean and makes you look like a perfectionist who gets it right the first time. Just remember: only do this on local branches that haven't been pushed yet to avoid rewriting history for your teammates!