Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Mastering the Patch Flag in Git
March 13, 2026
Ever found yourself finishing a long coding session only to realize you’ve changed five different things across three files? Instead of committing everything in one giant "fix stuff" blob, try using "git add -p". This "patch" flag opens an interactive mode that lets you review every single change (or hunk) individually.
You can decide to stage, skip, or even split specific lines of code. It’s a fantastic way to keep your commit history clean, perform a mini self-code-review before pushing, and ensure that experimental "console.log" you forgot didn't make it into production.