Skip to content

Commit 31ae908

Browse files
committed
Merge pull request #30 from p-v/branch-rename
Tip to rename a branch
2 parents 9f996ee + 274f663 commit 31ae908

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
* [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory)
5050
* [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules)
5151
* [Show all commits in the current branch yet to be merged to master](https://github.com/git-tips/tips#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master)
52+
* [Rename a branch](https://github.com/git-tips/tips#rename-a-branch)
5253

5354
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
5455
<!-- @doxie.inject end toc -->
@@ -341,5 +342,16 @@ __Alternatives:__
341342
git cherry -v master <branch-to-be-merged>
342343
```
343344

345+
## Rename a branch
346+
```sh
347+
git branch -m <new-branch-name>
348+
```
349+
350+
351+
__Alternatives:__
352+
```sh
353+
git branch -m [<old-branch-name>] <new-branch-name>
354+
```
355+
344356
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
345357
<!-- @doxie.inject end -->

tips.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,10 @@
191191
"title": "Show all commits in the current branch yet to be merged to master",
192192
"tip": "git cherry -v master",
193193
"alternatives": ["git cherry -v master <branch-to-be-merged>"]
194+
},
195+
{
196+
"title": "Rename a branch",
197+
"tip": "git branch -m <new-branch-name>",
198+
"alternatives": ["git branch -m [<old-branch-name>] <new-branch-name>"]
194199
}
195200
]

0 commit comments

Comments
 (0)