Skip to content

Instantly share code, notes, and snippets.

@esebastian
Created September 9, 2014 07:44
Show Gist options
  • Save esebastian/09e10bf39246effc3855 to your computer and use it in GitHub Desktop.
Save esebastian/09e10bf39246effc3855 to your computer and use it in GitHub Desktop.
Allow git completion for a custom alias
# see: https://askubuntu.com/questions/62095/how-to-alias-git-to-g-so-that-bash-completion-rules-are-preserved/62098#62098
git_alias_complete()
{
alias='g'
complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \
|| complete -o default -o nospace -F _git $alias
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment