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

# Git

```bash
git tag # 显示所有 tag
git checkout <tag> # 切换到 tag 所处的 commitId
git checkout -b <branch> <tag> # 切换到 tag，并创建分支

# 仅克隆某个 commitId 的内容
git clone --single-branch --depth 1 --branch v5.6.3 {url}
```

## Config

```bash
# 做此配置，输入一次密码后，再也不用输入密码
git config credential.helper store
```

## Stash

```bash
git stash # 暂存（存储在本地，并将项目本次操作还原）
git stash list # 查看所有的暂存
git stash pop # 使用上一次暂存，并将这个暂存删除
git stash apply # 使用某个暂存，但是不会删除这个暂存
git stash clear # 清空所有的暂存
```

## Remote

```bash
git remote -v # 查看 remote 详情

git remote set-url origin [url] # 重新设置 remote 的 url

git remote rm origin
git remote add origin [url]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://yunzhao.gitbook.io/notes/other/git.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
