---
title: "分支、标签与远程仓库"
description: "在 gitā 中检出、创建、重命名和删除分支，设置上游分支、创建标签、管理远程仓库，并在获取、拉取和推送前通过弹窗预览即将发生的变化。"
url: https://getgita.app/zh-hans/features/branches
lang: zh-Hans
---

# 分支、标签 与远程仓库

侧边栏列出了你的所有分支、远程仓库、标签和贮藏。在任意一项上右键点击，所有可用操作都在其中。

A live copy of the app is on the page: https://getgita.app/zh-hans/features/branches

## 试试看

1. 右键点击侧边栏中的某个分支。
2. 点击工具栏中的 **分支** 按钮新建一个分支。
3. 点击工具栏中的仓库名称切换分支。
4. 依次点击 **获取** 和 **推送**。

## 分支与远程

- **每个分支一个菜单.** 检出、合并到当前分支、变基到其上、推送、重命名、设置上游分支、删除、在浏览器中打开或复制名称。历史记录中的分支标签上也有完全相同的菜单。
- **文件夹中的分支.** 名称中带有斜杠的分支（如 feature/checkout）会在侧边栏自动归类为文件夹。
- **标签.** 可以在任意提交上创建轻量标签或附带说明的附注标签。
- **远程仓库.** “管理远程仓库”会列出每个远程仓库及其地址。支持添加、修改地址、重命名、移除或从中获取。GitHub、GitLab 和 Bitbucket 仓库会显示各自的图标。
- **获取、拉取与推送.** 每项操作都会先打开确认弹窗。获取支持同步所有远程仓库；拉取可选仅快进、合并或变基，并可自动贮藏再恢复更改；推送支持附带标签并为新分支设置上游。
- **谨慎的强制推送.** 如果远程仓库存在你尚未获取的提交，强制推送会自动停止，防止误覆盖他人的工作。
- **安全删除.** “删除本地分支”只会删除已经完成合并的分支。

## Questions, answered

### Is force push safe in gitā?

Force Push stops if the remote has commits you have not fetched, so you do not overwrite someone else's work by accident.

### Can I manage remotes in gitā?

Yes. Manage Remotes lists each remote with its address. Add one, change its address, rename it, remove it or fetch from it.

[全部功能](https://getgita.app/zh-hans/features.md)

- **下载 macOS 版:** https://github.com/rolottr/gita/releases/latest
- **在 GitHub 上查看:** https://github.com/rolottr/gita

---

Apple, macOS and Mac are trademarks of Apple Inc. Git is a trademark of Software Freedom Conservancy. GitHub is a trademark of GitHub, Inc. Vercel is a trademark of Vercel Inc. Claude is a trademark of Anthropic, PBC. gitā is independent software and is not affiliated with any of them. 问题反馈: https://github.com/rolottr/gita/issues
