see branch name in iterm2 code example Example 1: get current branch name git git rev-parse --abbrev-ref HEAD Example 2: see name of origin + git git remote -v