How do you list all tags in a repository?
Posted by RoseHrs
Last Updated: June 25, 2024
To list all tags in a Git repository, you can use the following command in your terminal or command prompt:
git tag
This command will display a list of all the tags that exist in the repository. If you want to see more detailed information about the tags, such as their commit messages, you might want to use:
git show-ref --tags
This will show you the tag names along with the corresponding commit hashes. If you're interested in specific tag prefixes or require sorting/tag formatting options, you can also modify the command. For example: - To list tags with a specific pattern, you can use the following command:
git tag -l 'v1.*'
This will list all tags that start with v1.. Remember to run these commands in the directory of the repository you want to inspect.