Skip to content

Instantly share code, notes, and snippets.

@rroblak
Created February 7, 2020 18:13
Show Gist options
  • Save rroblak/bda6675897c768db213ca3dc8f8b4908 to your computer and use it in GitHub Desktop.
Save rroblak/bda6675897c768db213ca3dc8f8b4908 to your computer and use it in GitHub Desktop.
Alias `git` to `g` with support for `hub` if it's installed
# Alias `hub` to `git` if it's installed.
if [[ ! -z $(command -v hub) ]]; then
eval "$(hub alias -s)"
fi
# Alias `git` to `g` and set up completion (also brings in `hub` completion if it's installed).
alias g=git
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
__git_complete g _git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment