Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Master Your Commits with Patch Mode

May 4, 2026

Ever find yourself halfway through a feature only to realize you've fixed three unrelated bugs and formatted five files? Instead of dumping everything into one messy commit, try using git add -p. This "patch" mode lets you review every single change hunk by hunk, allowing you to selectively stage only what belongs in your current logical unit.

It's like a mini-code review for yourself before you even push. It keeps your history clean and makes your teammates' lives much easier during PR reviews. Plus, it’s a great way to catch those accidental console.log statements before they hit the repo!