> For the complete documentation index, see [llms.txt](https://pointsource.gitbook.io/crowwrite/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pointsource.gitbook.io/crowwrite/2024/1108-git-tag.md).

# 1108-git tag

To add a tag in Git, you can use the following commands:

#### 1. Create a Tag

You can create a tag at the current commit (HEAD) using:

```bash
git tag <tag_name>
```

Replace `<tag_name>` with the name you want to give to the tag.

#### 2. Tag a Specific Commit

If you want to tag a specific commit (not the current HEAD), you can do so by specifying the commit hash:

```bash
git tag <tag_name> <commit_hash>
```

Replace `<tag_name>` with the tag name and `<commit_hash>` with the commit hash.

#### 3. Add a Lightweight Tag (Simple Tag)

The above method creates a *lightweight* tag. It is simply a reference to a commit.

#### 4. Create an Annotated Tag (More Detailed Tag)

To add a tag with more details (e.g., author, date, and message), you can create an annotated tag using:

```bash
git tag -a <tag_name> -m "Your tag message"
```

The `-a` flag specifies an annotated tag, and `-m` allows you to add a message.

#### 5. Push a Tag to a Remote Repository

By default, tags are not pushed to remote repositories. To push a tag, use:

```bash
git push origin <tag_name>
```

To push all tags to the remote repository, use:

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

Let me know if you'd like more details on any of these steps!
