Skip to content

Instantly share code, notes, and snippets.

@xlson
Created April 4, 2011 13:14
Show Gist options
  • Save xlson/901615 to your computer and use it in GitHub Desktop.
Save xlson/901615 to your computer and use it in GitHub Desktop.
git bash completion and git info in bash prompt (taked from jboss instruction)
GIT_COMPLETION_PATH="/usr/local/git/contrib/completion/git-completion.bash"
if [ -f "$GIT_COMPLETION_PATH" ]; then
GIT_PS1_SHOWDIRTYSTATE=true
. "$GIT_COMPLETION_PATH"
ADD_PS1='$(__git_ps1)'
fi
if [[ ${EUID} == 0 ]] ; then
PS1="\[\033[01;31m\]\h\[\033[01;34m\] \w\[\033[33m\]$ADD_PS1\[\033[34m\] \$\[\033[00m\] "
else
PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[33m\]$ADD_PS1\[\033[34m\] \$\[\033[00m\] "
fi
@xlson
Copy link
Author

xlson commented Apr 4, 2011

Copied from jboss wiki for safe keeping :)

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment