view what git branch you are on code example Example: get current branch name git git rev-parse --abbrev-ref HEAD