Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Mastering the Partial Commit with Git Add Patch
May 16, 2026
Ever find yourself finishing a feature but realizing you’ve left a bunch of debug console.log statements or unrelated formatting changes in the mix? Instead of staging the whole file, try using git add -p. This opens up an interactive mode where Git breaks your changes into "hunks," allowing you to decide piece-by-piece what actually makes it into the commit. It’s a lifesaver for keeping your pull requests clean and focused on a single task.