# 创建分支

![](/files/-LezYaslXG3gWAr_gh8A)

## 创建分支

当你在做一个项目时，你可能会在任何时间里有一堆不同的功能或想法——其中一些已经准备就绪，另一些则没有。分支的存在可以帮助你管理这些工作流。

在项目中创建分支时，你可以创建一个用于尝试新想法的环境。在新分支上所做的更改不会影响 `master` 分支，因此可以自由地进行实验和提交更改，完全可以放心，这个新分支直到被协作人评审后才会合并。

### 高级技巧

分支是 Git 的一个核心概念，整个 GitHub 工作流也是基于分支运作的。只有一条规则：`master` 分支中的内容始终都是可部署的。

因此，在处理功能或修复时，创建一个新的分支是十分重要的。分支名应该是描述性的（例如，`refactor-authentication`，`user-content-cache-key`，`make-retina-avatars`），以便其他人可以看出相应分支是在处理什么内容。


---

# 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://github.highlight.ink/github-flow/create-a-branch.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.
