Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Mastering Git Patch Mode

February 16, 2026

Ever find yourself finishing a feature only to realize you’ve also fixed two unrelated bugs and added a few console logs you shouldn't commit? Instead of committing everything in one messy blob, try using `git add -p`. This "patch" mode lets you review every single change (hunk) individually.

You can decide to stage it, skip it, or even split a large hunk into smaller pieces. It’s basically a final code review for yourself before anything touches the repository, ensuring your commit history stays clean and intentional.