Command

git symbolic-ref

Read the current symbolic branch target. A detached HEAD returns a nonzero status; --quiet suppresses the diagnostic.

Formal Syntax & Structure

git syntaxgit
git symbolic-ref --short HEAD

Working Example

Example Snippetgit
git symbolic-ref --short HEAD
Git Reference