Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Precision Commits with Patch Mode

March 1, 2026

We’ve all been there: you’ve spent an hour coding and realized you’ve fixed three different bugs and added a feature, all in the same file. Instead of doing a blind git add ., try using git add -p. This "patch" mode breaks your changes down into small chunks (hunks) and asks you if you want to stage each one individually.

It forces you to review your code one last time before committing and ensures your pull requests stay focused and easy for your teammates to review. If a hunk is too big, you can even split it into smaller pieces by hitting 's' during the prompt.