Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Clean Up Your Commits with Patch Mode

May 1, 2026

We've all been there: you fixed a bug, but you also refactored three other functions and added some console logs you forgot to remove. Instead of running a blanket 'git add .', try using 'git add -p'. This puts Git into patch mode, which breaks your changes down into small 'hunks' and asks you if you want to stage each one individually.

This practice forces you to review your code one last time before it hits the repository. It’s the single best way to ensure your commit history stays focused, professional, and free of accidental debug statements that should have never left your local machine.