Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Atomic Commits with Git Patch

March 19, 2026

We’ve all been there: you’ve spent an hour coding and realized you’ve fixed a bug, refactored a function, and updated a README all in the same file. Instead of dumping it all into one messy commit, use git add -p. This 'patch' mode lets you review every change (hunk) and decide whether to stage it or not. It keeps your commit history clean and makes life much easier for whoever is reviewing your pull request.