Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Mastering Selective Staging

February 18, 2026

Ever finished a long coding session only to realize you’ve touched five different files and solved three unrelated bugs? Instead of dumping everything into one messy commit, try using git add -p. This "patch" mode lets you review every single change (or "hunk") line by line, giving you the choice to stage it, skip it, or even split it further.

It's a fantastic way to keep your pull requests clean and your commit history readable for the rest of the team. Plus, it acts as a final self-review before you push, helping you catch those stray console logs or temporary comments before they ever hit the repository.