Open ~/.zprofile
or ~/.zshrc
in your favorite editor and add the following content to the bottom.
( if the file ~/.zprofile or ~/.zprofile does not already exist create it)
# Git branch in prompt.
function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}