Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Mastering the Git Patch Mode
February 12, 2026
Ever find yourself finishing a long coding session only to realize you’ve touched five different files and solved three separate problems? Instead of dumping everything into one messy commit, try using git add -p. This patch mode lets you review your changes hunk by hunk, deciding exactly what goes into the staging area and what stays behind for the next commit.
It’s a fantastic way to catch stray console logs or temporary comments before they hit the repo. It essentially forces you to double-check your work one last time, making your commit history much cleaner and significantly easier for your teammates to review during a PR.