Mar 4, 2013 git · autocomplete · shorthand · shortcuts · bash

Autocomplete "git" as "g"

For all you lazy Git bums, here’s how you can type “g” got “git” and still have autocompletion (paste into your ~/.bash_profile or .dotfiles system):

alias g='git'
complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \
    || complete -o default -o nospace -F _git g