Skip to content

Instantly share code, notes, and snippets.

@cigumo
Created January 4, 2012 21:54
Show Gist options
  • Save cigumo/1562382 to your computer and use it in GitHub Desktop.
Save cigumo/1562382 to your computer and use it in GitHub Desktop.
git prompt for bash
# git branch in prompt
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function git_prompt {
PS1="\r\n[\u@\h:\e[1m\w\e[0m] $(parse_git_branch)\r\n\\$ "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment