Add the following config to .zshrc
:
# Load colors
autoload -U colors && colors
# Load version control information
autoload -Uz vcs_info
precmd() { vcs_info }
# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:git:*' formats '(%b)'
# Set up the prompt (with git branch name)
setopt PROMPT_SUBST
PROMPT='[%1~] %{$fg[cyan]%}${vcs_info_msg_0_}%{$reset_color%} %# '