Skip to content

Instantly share code, notes, and snippets.

@davidnaviaweb
Created October 11, 2018 08:21
Show Gist options
  • Save davidnaviaweb/0cb6fd1ecda660bd2d86b448e79d2c46 to your computer and use it in GitHub Desktop.
Save davidnaviaweb/0cb6fd1ecda660bd2d86b448e79d2c46 to your computer and use it in GitHub Desktop.
Git alias for .bash_profile
# ----------------------
# Git Aliases
# ----------------------
alias g='git'
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
function_exists() {
declare -f -F $1 > /dev/null
return $?
}
for al in `__git_aliases`; do
alias g$al="git $al"
complete_func=_git_$(__git_aliased_command $al)
function_exists $complete_fnc && __git_complete g$al $complete_func
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment