Prompt with git branch

I think I like this:

[cc lang=”bash”]
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != “nothing to commit (working directory clean)” ]] && echo “*”
}
function parse_git_branch {
git branch –no-color 2> /dev/null | sed -e ‘/^[^*]/d’ -e “s/* \(.*\)/[\1$(parse_git_dirty)]/”
}

export PS1=’${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\w\[\033[01;32m\] $(parse_git_branch) \[\033[01;36m\]$ \[\033[00m\]’
[/cc]