Files
freeCodeCamp/guide/chinese/miscellaneous/rename-local-branches-in-git/index.md
2018-10-16 21:32:40 +05:30

22 lines
534 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Rename Local Branches in Git
localeTitle: 在Git中重命名本地分支
---
要重命名本地分支,请在终端中输入以下内容:
> `-m`代表move就像`mv`在linux中用来重命名文件一样。
```
git branch -m <oldname> <newname>
```
如果您已经签出了要更改的分支:
```
git branch -m <newname>
```
下面是一个重命名`feature/react-challenges`分支来`fix/react-hikes`来自FreeCodeCamp的示例
```
git checkout feature/react-challenges
git branch -m fix/react-hikes
```