Forked from JuggoPop/Git branch bash autocomplete *with aliases*
Last active
February 20, 2017 09:08
-
-
Save tucq88/241fd5482fb2fe8541367301466a86f4 to your computer and use it in GitHub Desktop.
Git branch bash autocomplete *with aliases* (add to .bash_profile)
This file contains 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
# To Setup: | |
# 1) Save the .git-completion.bash file found here: | |
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash | |
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect: | |
#TODO Make bash dir and go to | |
mkdir ~/.bash && cd ~/.bash | |
#TODO CURL to get the file | |
curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash | |
# Git branch bash completion | |
if [ -f ~/.bash/.git-completion.bash ]; then | |
. ~/.bash/.git-completion.bash | |
# Add git completion to aliases | |
__git_complete g __git_main | |
fi | |
# Make sure you actually have those aliases defined, of course. | |
alias g="git" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment