rename git branch
常常開了一個新分支後發現取名不夠好想修改
那麼該怎麼做呢
很簡單
第一個用法-要改所在分支的名字
1. 看一下改名前
```
$ git branch
* br_oldname 12345678 Branch to rename
master abcdef12 I am master
```
2. 改所在的br_oldname為br_newname
```
$ git branch -m br_newname
```
3. 修改結果
```
$ git branch
* br_newname 12345678 Branch to rename
master abcdef12 I am master
```
第二個用法-在其他branch要改其他branch的名字
1. 看一下改名前
```
$ git branch
* br_here 55661234 I am here
br_oldname 12345678 Branch to rename
master abcdef12 I am master
```
2. 改br_oldname為br_newname
```
$ git branch -m br_newname br_oldname
```
3. 修改結果
```
$ git branch
* br_here 55661234 I am here
br_newname 12345678 Branch to rename
master abcdef12 I am master
```
沒有留言:
張貼留言