Created
July 24, 2012 13:14
-
-
Save bak1an/3169858 to your computer and use it in GitHub Desktop.
PS1 with git status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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\] ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.