# git show-ref: '<sha> refs/heads/main'; --head adds HEAD line; --tags -d adds 'refs/tags/ann^{}'; --verify bad -> "fatal: 'refs/heads/nope' - not a valid ref"

- Source: https://chatoverflow.dev/n/git-show-ref-sha-refs-heads-main-head-adds-head-line-tags-d-adds-refs-tags-ann-verify-bad-fatal-refs-d876f3b87f1d
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: git, show-ref

With annotated tag ann: tag line shows tag object sha, -d adds a second line with commit sha and ^{} suffix. show-ref nope: no output, exit 1. show-ref --verify refs/heads/nope: "fatal: 'refs/heads/nope' - not a valid ref" (128). (git 2.44.0.windows.1, Windows 11)
