Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Master the Patch in Git
March 11, 2026
Ever finish a long coding session and realize you’ve made three different logical changes in one file? Instead of committing them all together, try using 'git add -p'. This patch mode lets you review each change individually, allowing you to stage only the parts that belong to a specific feature. It’s a great way to keep your commit history clean and readable for your teammates.
If a hunk of code is too big, you can even hit 's' to split it into smaller pieces. It turns a messy 'fixed everything' commit into a series of meaningful, atomic updates that are much easier to roll back if something goes wrong later.