Skip to content

Instantly share code, notes, and snippets.

@bak1an
Created July 24, 2012 13:14
Show Gist options
  • Save bak1an/3169858 to your computer and use it in GitHub Desktop.
Save bak1an/3169858 to your computer and use it in GitHub Desktop.
PS1 with git status
# put git-completion.bash and git-prompt.sh from contrib/completion to SOMEDIR
for f in $SOMEDIR/*; do source $f; done
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1)\[\033[00m\]\[\033[01;34m\] \$\[\033[00m\] '
@tsipinio
Copy link

Add line: alias __git_ps1="git branch 2>/dev/null | grep '' | sed 's/ (.*)/(\1)/'" for mac users. Because Mac OS X installations of Git don't have __git_ps1 included.

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