# 管理数据集分支

## 通过分支管理数据集 <a href="#id-1" id="id-1"></a>

* 在不影响原数据集和其他数据分支版本的情况下，分支管理功能可以让用户安全地在不同的原数据集分支版本上根据需求做改动，对数据集进行比较实验。
* 多个用户可以通过Branch同时编辑各自的数据集，了解Commit或Branch之间的关系以及每个版本的来源，不会干扰彼此的工作。

### 默认分支 <a href="#id-1-1" id="id-1-1"></a>

在TensorBay上创建数据集时，将自动创建默认分支（Default Branch）为第一个分支，该分支默认命名为“main“，支持默认分支重命名或切换默认分支。

### **查看分支** <a href="#id-1-2" id="id-1-2"></a>

* **方法1：**&#x521B;建branch成功后，将自动切换至该branch详情页。
* **方法2：**&#x8FDB;入任意版本的数据集详情页，点击左上角的下拉单，切换至目标Branch，查看其最新版本的数据详细信息，进行筛选或创建Draft完成数据集修改。

![切换至目标分支](/files/-Mbdfxqy1iVV4lCDCmpI)

### 创建分支 <a href="#id-1-3" id="id-1-3"></a>

* **基于原有分支/ Tags/ Commit 创建新分支**
  * 进入数据集详情页，点击左上角切换版本的下拉单，选择一个分支 / Tag 并切换；或点击【查看所有tag】进入Commit记录列表，点击右侧<img src="/files/-Mbde-ujQxcocyPYDzsb" alt="" data-size="line">图标切换。
  * 进入相应数据集详情页后，点击左上角切换版本的下拉单，在【查找或创建Branch】输入框中输入新分支名称，完成【创建】。

![](/files/-MbdhkPbFXSJy81uRnhM)

### 删除 / 重命名分支 <a href="#id-1-4" id="id-1-4"></a>

* 进入branch列表详情页面。
* 对任意branch，点击右侧删除 / 重命名按钮，即可删除 / 重命名branch

![](/files/-MbdhvsOQCD56WHUyTy_)

{% hint style="info" %}
&#x20;default branch不能删除，但可以重命名。
{% endhint %}

### 切换分支 <a href="#id-1-5" id="id-1-5"></a>

进入branch列表详情页面之后，点击切换branch按钮，选择需要切换default branch的目标branch，即可切换。

![Branch 列表页](/files/-MbdhSDcrkV4BSrEhwnf)

![切换分支](/files/-MbdhNIS8vQvgXtuCtmb)


---

# 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://docs.graviti.cn/guide/tensorbay/version/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.
