Things Winston Taught Me - Better Git Shortcuts

Mar 3, 2017

As I discussed in my article on what Ganesh taught me, working with another engineer is a great way to learn new things. Last week I also worked with Winston and he showed me some git short cuts you can add to your bash profile.

How I Use Git

I’ve tried a number of git UI tools over the years but I keep coming back to the command line. Here’s my work flow:

git status

git add some_file

git commit -m “a commit message”

git push origin master

I’m pretty much a straight command line guy. And because I try very hard to avoid rollup commits, this can make the commit process tedious.

How Winston Uses Git

Winston showed me his process:

gs

ga

gc “a commit message”

gpc

These abbreviations are a heck of a lot shorter than what I’ve been typing so that’s clearly a win. My one objection to his approach is that ga adds EVERYTHING. My preference is atomic commit messages where one commit = the changes to one file so I really would prefer to have two aliases for add: