Forrest logo
back to the git tool

git-show-ref:tldr:873a1

git-show-ref: Show only tags references.
$ git show-ref --tags
try on your machine

The git show-ref --tags command is used to display the references of tags in a Git repository.

When you create a tag in Git, it acts as a permanent reference to a specific commit. Tags are typically used to mark important points in history, such as release versions or milestones. By default, Git stores tags as references to commits rather than storing the entire commit object itself.

The git show-ref --tags command displays the references of all tags in the repository. It lists the names of the tags along with the corresponding commit hash that they are pointing to. This helps you identify and verify the tags that exist in your repository and the commits they are associated with.

For example, the output of git show-ref --tags might look like this:

2358f0d97d8d713cf1f8b6484c706fad36be1f98 refs/tags/v1.0
d68bb387d7eb812cf7469e15b9cbd8a265ba1d23 refs/tags/v1.1
874b16f2d942e53572f4fc5b283706853dd74a09 refs/tags/v1.2

In this example, it shows that there are three tags named v1.0, v1.1, and v1.2 respectively, and it provides the commit hashes associated with each tag.

Overall, git show-ref --tags is useful for inspecting and managing the tags in your Git repository.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool