Created
April 6, 2011 18:58
-
-
Save andrewwatts/906277 to your computer and use it in GitHub Desktop.
script to add git-completion.bash to a bash shell
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
#!bash -x | |
mkdir -p $HOME/bin | |
pushd $HOME/bin | |
curl -fsSLO https://github.com/andrewwatts/dotfiles/raw/master/bin/git-completion.bash | |
popd | |
cat >> $HOME/.bashrc << EOF | |
# BEGIN git install from https://gist.github.com/gists/1536b5ada40498fbb768 | |
test -r "$HOME/bin/git-completion.bash" && { | |
BLACK="\[\033[0;30m\]" | |
RED="\[\033[0;31m\]" | |
GREEN="\[\033[0;32m\]" | |
YELLOW="\[\033[0;33m\]" | |
BLUE="\[\033[0;34m\]" | |
MAGENTA="\[\033[0;35m\]" | |
CYAN="\[\033[0;36m\]" | |
WHITE="\[\033[0;37m\]" | |
RESET="\[\033[0m\]" | |
function __virtualenv_ps1 { | |
[ "\$VIRTUAL_ENV" ] && echo '('\$(basename \$VIRTUAL_ENV)') ' | |
} | |
. $HOME/bin/git-completion.bash | |
export GIT_PS1_SHOWDIRTYSTATE=true | |
PS1="\n\${GREEN}\\\$(__virtualenv_ps1)\${RESET}\u@\h:\${CYAN}\W\${RESET} \${GREEN}\\\$(__git_ps1 '(git::%s)')\${RESET}\n$ " | |
} | |
EOF | |
. $HOME/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment