git branch in my bash prompt

# Add the following function to your .bashrc or .bash_profile file
parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^]/d' -e 's/ \(.*\)/ (\1)/'
}

# Modify the PS1 environment variable to include the current Git branch
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$(parse_git_branch)\$ "