Skip to content

Instantly share code, notes, and snippets.

@goosetav
Created March 21, 2014 23:30
Show Gist options
  • Save goosetav/9698683 to your computer and use it in GitHub Desktop.
Save goosetav/9698683 to your computer and use it in GitHub Desktop.
example of installing git-prompt into an existing PS1 prompt; now in color!
# git-ify shell prompt
source ~/.git-prompt.sh
GIT_PS1='$(__git_ps1 " \[\033[0;32m\]%s\[\033[0m\]")'
export GIT_PS1_SHOWDIRTYSTATE="1"
export GIT_PS1_SHOWUPSTREAM="auto"
# example PS1 prompt or include $GIT_PS1 into yoru existing prompt
export PS1="\[\e]2;\u \w\a\e[32;1m\]$SI\w$NM$GIT_PS1 #\[\e[0m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment