symbolic ref

A ref that holds the name of another ref instead of an object ID, as HEAD normally holds the name of a branch.

In more detail

git symbolic-ref HEAD prints the branch HEAD points at, such as refs/heads/main, and fails when HEAD is detached. git rev-parse HEAD follows the chain to the commit ID instead.

Example

git symbolic-ref HEAD

Related terms

Taught in

References