Created
April 18, 2014 14:35
-
-
Save ddre54/11047350 to your computer and use it in GitHub Desktop.
Git: Displays current branch in the 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
# Add git branch to the prompt | |
# http://codeinthehole.com/writing/pull-requests-and-other-good-practices-for-teams-using-github/ | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /' | |
} | |
PS1="\[\e[32m\]\$(parse_git_branch)\[\e[34m\]\h:\W \$ \[\e[m\]" | |
export PS1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment