At the recommendation of a coworker, I started using GitHub desktop client. But, personally, I don’t use it for more than a colorful, neatly organized review of
-‘s before I push to Jana’s remote GitHub. For everything else
git, I prefer the command line.
Getting some of the same conveniences as a GUI client from the command line is as easy as using the
-p flag with certain commands.
--patch will put git into an interactive mode that displays one small hunk of change at a time, letting you apply a number of different commands to it. Using
-p with commands like
checkout gives you the power to stage, stash, discard, edit, or ignore individual additions or deletions in your branch.
Adding small hunks keeps my commits small and specific and forces me to review code one more time before committing. Stashing and re-applying code speeds up my TDD and debugging. Checkout-ing code is just satisfying. 🙂