Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Master Git's Interactive Staging

May 11, 2026

Ever find yourself finishing three different tasks before remembering to commit? Instead of dumping everything into one giant "updates" commit, try using git add -p. This opens an interactive mode that lets you review each "hunk" of code changes one by one. You can decide to stage it, skip it, or even manually edit the hunk if you only want part of a line to go in.

It’s a lifesaver for keeping your commit history clean and readable for your future self and your teammates. It forces you to actually look at what you're committing, which is often the best way to catch a stray console.log or a temporary comment before it hits the main branch.