Skip to content

Instantly share code, notes, and snippets.

@gchaix
Created August 9, 2016 18:41
Show Gist options
  • Save gchaix/c975838759dc2b69cf1e5eeb99affd37 to your computer and use it in GitHub Desktop.
Save gchaix/c975838759dc2b69cf1e5eeb99affd37 to your computer and use it in GitHub Desktop.
# git-prompt
export GIT_PS1=1
if [ -f /usr/local/bin/git-prompt.sh ] && [ $GIT_PS1 -ne 0 ]; then
source /usr/local/bin/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWCOLORHINTS=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
#export PS1=${PS1}$(__git_ps1 "\n(%s)\$ ")
if [ "${SERVER_TYPE_PROMPT}" ]; then
PROMPT="${SERVER_TYPE_PROMPT}\[\033]0;\u@\h:$PWD\007\]"
fi
if [ ${EUID} == 0 ] ; then
PROMPT_COMMAND='__git_ps1 "${PROMPT}\[\033[01;31m\]\u@\h\[\033[01;34m\]:\W\[\033[00m\]" "\\\$ "'
else
PROMPT_COMMAND='__git_ps1 "${PROMPT}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]" "\\\$ "'
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment