git-rename-branch - Man Page
rename local branch and push to remote
Examples (TL;DR)
- Rename the branch you are currently on:
git rename-branch new_branch_name
- Rename a specific branch:
git rename-branch old_branch_name new_branch_name
Synopsis
git-rename-branch <old-branch> <new-branch>
Description
Rename local branch and push the new branch to remote
Options
<old-branch> Old branch whose has to be renamed. This is an optional parameter. If no value is supplied then the current branch will be renamed. <new-branch> New branch name
Examples
$ git rename-branch old-name new-name $ git rename-branch new-name
Author
Written by Hozefa Jodiawalla <hozefarules@gmail.com>
Reporting Bugs
See Also
Referenced By
July 2019 Git Extras