Skip to content

Instantly share code, notes, and snippets.

@emil-palm
Created August 16, 2012 09:12
Show Gist options
  • Save emil-palm/3368661 to your computer and use it in GitHub Desktop.
Save emil-palm/3368661 to your computer and use it in GitHub Desktop.
Setup git completion and a good PS1 var.
URLS="https://raw.github.com/git/git/master/contrib/completion/git-completion.bash https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh"
DONE=0
which "wget" >> /dev/null
if [ $? -eq 0 ]; then
for url in $URLS; do
OUT=$(echo $url | cut -f9 -s -d/)
wget $url -q -O ~/.$OUT
done
DONE=1
fi
which "curl" >> /dev/null
if [ $DONE -eq 0 ] && [ $? -eq 0 ]; then
for url in $URLS; do
OUT=$(echo $url | cut -f9 -s -d/)
curl $url -s -o ~/.$OUT
done
DONE=1
fi
if [ $DONE -eq 1 ]; then
echo "source ~/.git-completion.bash
source ~/.git-prompt.sh
PS1='[\u@\h \W\$(__git_ps1 \" (%s)\")]\\$ '" >> ~/.bashrc
echo "Done installing"
else
echo "Unable to download files"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment