# 致命错误：名为'feature/new-ui'的分支已存在

- **ID:** `git/rename-branch-conflict`
- **领域:** git
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

尝试创建或重命名分支到已存在的分支名称

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| git 2.42.0 | active | — | — |
| git 2.43.0 | active | — | — |
| git 2.44.0 | active | — | — |

## 解决方案

1. ```
   Delete the existing branch first if safe: git branch -D feature/new-ui && git branch -m old-name feature/new-ui
   ```
2. ```
   Force push the renamed branch after local rename: git push origin --delete feature/new-ui && git push origin feature/new-ui
   ```

## 无效尝试

- **Using 'git branch -m old new' when 'new' already exists on remote** — Local rename does not check remote; push will fail with non-fast-forward (80% 失败率)
- **Deleting the local branch with 'git branch -D new' then trying to rename** — Remote branch still exists; push will still fail (70% 失败率)
