Skip to content

Instantly share code, notes, and snippets.

@cigumo
cigumo / gist:1562382
Created January 4, 2012 21:54
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\\$ "
}