Patching Your Workflow

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 and -‘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. -p or --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 add, stash, or 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. 🙂

Tags: ,


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s