# git checkout指定tag

当需要checkout一个仓库的特定tag时候，不是使用 `git checkout -b` 指令，而是使用 `git fetch`

```
git fetch && git fetch --tags
```

由于tag通常不会下载，所以需要指定tag

```
git checkout v1.0.1
```

## 参考

* [Git clone a repository and checkout a specified tag](https://coderwall.com/p/k2fisg/git-clone-a-repository-and-checkout-a-specified-tag)


---

# 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://huataihuang.gitbook.io/cloud-atlas-draft/devops/git/git_checkout_specified_tag.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.
