how to check which branh you on git code example Example: get current branch name git git rev-parse --abbrev-ref HEAD