How do you list all tags in a Git repository?

How do you list all tags in a Git repository?

a) git tags
b) git tag --list
c) git tag -a
d) git list-tags

Answer:

b) git tag --list

Explanation:

The git tag --list command lists all tags in the repository. Tags are typically used to mark specific points in the repository’s history, such as releases or important milestones.

You can also use git tag without options to list all tags, or apply filters like git tag -l "v1.*" to list specific versions.

Tags are an important part of version control, allowing you to reference key points in your project’s history.

Reference:

Top 100 Git and GitHub MCQ Questions and Answers

Scroll to Top