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

How to fix TypeError: Nil is not a Symbol or String

If you’re using the form helpers built into Rails (or a library like SimpleForm that’s built on top of them), you might run into a somewhat confusing error: TypeError: nil is not a symbol nor a string Usually this will originate from... Continue →