Typo Forgiveness in Git & Bash

I’m often moving pretty quickly when it comes time to commit work to Git. I have a bit of a workflow down, and I type the same few shortcuts frequently:

$ git st (expands to status)
$ git ks (expands to difftool, which opens Kaleidoscope)
$ git add -A
$ git ci (expands to commit)

Regularly, though, my fingers will transpose the t in Git and the space that follows it: gi tks.

This has become frequent enough that I finally took the time to address it by making the desired action still occur:

$ git config --global alias.tst status
$ git config --global alias.tks difftool
$ git config --global alias.tci commit

Then, in ~/.bash_profile:

alias gi=git

Now when I make a mistake, Git does what I want and I don’t lose my flow. It’s a small thing, but it’ll improve my day a little bit a dozen times a day.


Mentioned in this post: Kaleidoscope, the (mostly) fantastic diff visualizer from Black Pixel.

 
2
Kudos
 
2
Kudos

Now read this

Using Webster’s 1913 Dictionary on macOS Catalina, Big Sur, or Monterey

I recently had the pleasure of discovering James Somer’s blog through Instapaper’s weekly “top highlights” email. I found James’ post about the dictionary particularly compelling, and it seems I’m not alone. Alas, the instructions... Continue →