Created
November 27, 2009 15:54
-
-
Save rpanachi/244079 to your computer and use it in GitHub Desktop.
Display the git branch on terminal
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
#include on ~/.bashrc | |
PS1="\[\033[38m\]\u"; | |
PS1="$PS1\[\033[32m\] \w"; | |
PS1="$PS1\[\033[31m\]"; | |
PS1="$PS1\`git branch 2>/dev/null | grep \"^\*\" | \\ | |
sed -r \"s/\*\ (.*)/ \(\1\)/\"\`"; | |
export PS1="$PS1\[\033[37m\]$\[\033[00m\]"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment