Created
October 11, 2018 08:21
-
-
Save davidnaviaweb/0cb6fd1ecda660bd2d86b448e79d2c46 to your computer and use it in GitHub Desktop.
Git alias for .bash_profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------- | |
# 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