# Get Tag Names in Git

To get tag name in a git repository, we can use `git describe` command.

## Example: Get Latest Tag Name

```
git describe --tag
v0.5
```

## Example: Get All Tags Sorted by Commit Date

```
git tag --sort=committerdate
v0.1
v0.2
v0.3
v0.4
v0.5
```

***Source(s):***

* [StackOverFlow](https://stackoverflow.com/a/7261049)
* [GitHub Gist](https://gist.github.com/rponte/fdc0724dd984088606b0)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.devjugal.com/git/get-tag-names-in-git.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
