Branch
Show current branch
git branch --show-current
git rev-parse --abbrev-ref HEADList all branches
git branch -aShow remote principal branch
git remote show origin | grep HEAD | awk '{print $3}' # request from remote origin (lazy fetch)
git rev-parse --abbrev-ref origin/HEAD | sed 's#^origin/##' # origin/HEAD -> origin/main (fast)