Last active
August 27, 2019 14:57
-
-
Save artynet/4033796500a69881c05c4701748e8d88 to your computer and use it in GitHub Desktop.
quick git completion setup
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
#!/bin/bash -x | |
git_setup () { | |
cat << EOF | |
# git setup | |
GIT_PS1_SHOWDIRTYSTATE=true | |
GIT_PS1_SHOWCOLORHINTS=true | |
GIT_PS1_SHOWUNTRACKEDFILES=true | |
. $HOME/.git-completion.bash | |
. $HOME/.git-prompt.sh | |
EOF | |
} | |
gitversion=$(git --version | awk {'print $3'}) | |
url=https://raw.githubusercontent.com/git/git/v${gitversion}/contrib/completion | |
completion=("git-completion.bash" "git-prompt.sh") | |
for i in ${completion[@]} | |
do | |
wget $url/$i -O $HOME/.$i | |
done | |
git_setup >> ${HOME}/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment