FahamLah

Commands

git show-ref

git show-ref [--heads | --tags]

Risk: Safe

What it does

Lists your refs (branches and tags) with the commit id of each.

When to use it

To see every name Git keeps, in a script-friendly list.

Example

$ git show-ref

Each line: an id, then a ref like refs/heads/main.

$ git show-ref --heads

Only branches.