Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Git's Best Kept Secret: The Patch Flag

April 21, 2026

Ever finished a long coding session and realized you've changed three different things in one file? Instead of committing them all at once, use 'git add -p'. This opens a 'patch' mode that lets you review every single change (hunk) individually.

You can decide to stage some parts and leave others for a separate commit, keeping your history clean and logical. It's also a great final sanity check to make sure you didn't leave any stray console logs or debug comments in your code before pushing.