In brief
git show-ref lists locally known references and identifiers. With --verify it requires an exact path such as refs/heads/main rather than an ambiguous abbreviated match.
Useful to know
git show-ref lists locally known references and identifiers. With --verify it requires an exact path such as refs/heads/main rather than an ambiguous abbreviated match. [1]
This helps scripts distinguish a branch from a similarly named tag. Check the exit status, not only printed text. A locally known remote-tracking reference also does not establish the remote server’s current state.
Sources
For further detail and to check the information: