Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

The Secret to Clean Commits: Patch Mode

February 10, 2026

Ever finish a coding session only to realize you made three unrelated changes in one file (a bug fix, a refactor, and a commented-out line)? Don't commit everything together! Use `git add -p` (or `git add --patch`). This command lets you review changes hunk-by-hunk and decide exactly which specific blocks of code belong in your next commit. Atomic commits—commits that do one thing and one thing only—make reviewing and reverting changes infinitely easier for your teammates (and your future self when debugging.)