Skip to content

Instantly share code, notes, and snippets.

@artynet
Last active August 27, 2019 14:57
Show Gist options
  • Save artynet/4033796500a69881c05c4701748e8d88 to your computer and use it in GitHub Desktop.
Save artynet/4033796500a69881c05c4701748e8d88 to your computer and use it in GitHub Desktop.
quick git completion setup
#!/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