Skip to content

Instantly share code, notes, and snippets.

@AlexandreRio
Created January 29, 2014 17:44
Show Gist options
  • Save AlexandreRio/8693093 to your computer and use it in GitHub Desktop.
Save AlexandreRio/8693093 to your computer and use it in GitHub Desktop.
Git PS1 for bash
#On fedora __git_ps1 is not in git_completion.sh
if [ -f /usr/share/git-core/contrib/completion/git-prompt.sh ]; then
. /usr/share/git-core/contrib/completion/git-prompt.sh
fi
function set_bash_prompt {
PS1="\[$IGreen\]\u \[$Blue\]\w \[$Color_Off\]$(__git_ps1 '(%s)') > "
}
PROMPT_COMMAND=set_bash_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment