Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Mastering Git's Patch Mode

February 20, 2026

Ever find yourself finishing a feature only to realize you've accidentally included some messy console logs or a half-finished experiment in your changes? Instead of staging everything with 'git add .', try using 'git add -p'. This interactive patch mode lets you review every single change (hunk) individually and decide whether to stage it, skip it, or even split it further.

It's a lifesaver for keeping your commits clean and focused. By reviewing your code one more time as you stage it, you catch those tiny mistakes before they ever hit the repository, making your pull requests much easier for your team to review.