The `git tag` command is very useful for marking an important point in your repository's history. The most common use-case for this command is to mark a version or release point in your code.

## Creating a new tag and commit

You would type the following in your terminal to use this command:

```bash
$ git tag -a v1.1 -m "Version 1.1"
```

This would be used instead of `git commit -m "Version 1.1"` and create a new commit and assign the tag `v1.1` to it at the same time.

By default, tags are only created locally. To share a tag with your team, push it to the remote with [`git push`](/git/publishing-local-changes):

```bash
$ git push origin v1.1
```

Or push all tags at once:

```bash
$ git push --tags
```

## Tagging an old commit

If you want to assign a tag to a past commit, you can do so using this command:

```bash
$ git tag -a "v1.0" 1234abc
```

Where `1234abc` is your previous commit reference. You can find commit references using [`git log`](/git/viewing-previous-commits).

## Searching and using tags

You can view a list of previously added tags using the following command:

```bash
$ git tag

v1.1
v1.0
```

You'll see a full list of previous tags in the repository. If you have a large number of tags, you can even use a simple wildcard such as:

```bash
$ git tag -l "v1*"

v1.1
v1.0
```

To view all tags starting with `v1`.

You can then use any tag that exists in git operations, in exactly the same way that you might use a commit reference, such as [`git checkout`](/git/commands/git-checkout) or `git show`.

Once your code is ready, [DeployHQ](https://www.deployhq.com) can deploy it to your servers automatically from any Git repository.