![Forrest logo](/images/logo.png)
git-show-ref:tldr:edd7e
The command "git show-ref --heads" is used in Git to display the reference pointers that point to branch heads in your repository.
In Git, references (or refs) are pointers that point to specific commit objects within the repository's history. Branches in Git are simply references that move automatically as new commits are added.
When you run the "git show-ref --heads" command, Git will list all the branch heads in your repository. A branch head is the reference pointer that points to the latest commit on a branch.
The output of the command will typically be a list of references in the format "
For example, imagine you have two branches in your repository: "master" and "feature-branch". Running "git show-ref --heads" might show an output like:
e1a75c0e6f417f55f19b1d206091b6e1b6c4b14d refs/heads/master 0f326bb52f4ad8ab095fc1d6c7af55795e8fafae refs/heads/feature-branch
This output indicates that the branch "master" is pointing to commit "e1a75c0e6f417f55f19b1d206091b6e1b6c4b14d", and the branch "feature-branch" is pointing to commit "0f326bb52f4ad8ab095fc1d6c7af55795e8fafae".