Merge pull request #30 from p-v/branch-rename

Tip to rename a branch
This commit is contained in:
hemanth.hm 2015-08-19 15:09:33 +05:30
commit 31ae908a62
2 changed files with 17 additions and 0 deletions

View File

@ -49,6 +49,7 @@
* [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory)
* [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules)
* [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)
* [Rename a branch](https://github.com/git-tips/tips#rename-a-branch)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -341,5 +342,16 @@ __Alternatives:__
git cherry -v master <branch-to-be-merged>
```
## Rename a branch
```sh
git branch -m <new-branch-name>
```
__Alternatives:__
```sh
git branch -m [<old-branch-name>] <new-branch-name>
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -191,5 +191,10 @@
"title": "Show all commits in the current branch yet to be merged to master",
"tip": "git cherry -v master",
"alternatives": ["git cherry -v master <branch-to-be-merged>"]
},
{
"title": "Rename a branch",
"tip": "git branch -m <new-branch-name>",
"alternatives": ["git branch -m [<old-branch-name>] <new-branch-name>"]
}
]