Skip to content

Commit

Permalink
Added rename-git-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Unicar committed Oct 8, 2018
1 parent 27b2dc1 commit 2b6b710
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions git/rename-git-branch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
HTML comments inside of JSX won't work, you need to use JavaScript block comments and wrap them in curly brases:

1. Rename a local branch

if you are on the branch you want to rename:
```Git
git branch -m new-name
```
if you are on a different branch:
```Git
git branch -m old-name new-name
```
2. Delete the old-name remote branch and push the new-name local branch
```Git
git push origin :old-name new-name
```
3. Reset the upstream branch with the new-name local branch
```Git
git push origin -u -m new-name
```
source: [Rename a local and remote branch in git](https://multiplestates.wordpress.com/2015/02/05/rename-a-local-and-remote-branch-in-git/)

0 comments on commit 2b6b710

Please sign in to comment.