DEV Community

Toolloom
Toolloom

Posted on • Originally published at toolloom.com on

Master Git's Interactive Staging for Cleaner Commits

Ever find yourself ready to commit, but you've made changes across three different features in the same file? Instead of committing everything at once and writing a messy commit message, use git add -p (or --patch). This command lets you review your changes block by block (or 'hunk') and decide whether to stage it, skip it, or even split it into smaller pieces.

It keeps your pull requests incredibly clean and makes rolling back specific changes a breeze. Your team will thank you for the highly focused, readable commit history.

Top comments (0)