Git Rename Branch Local and Remote Securely

​1. Rename your local branch. 


If you are on the branch you want to rename: 

git branch -m new-name 


2. Delete the old-name remote branch and push the new-name local branch. 

git push origin :old-name new-name 


3. Reset the upstream branch for the new-name local branch. 

git push origin -u new-name


Thanks to https://multiplestates.wordpress.com/2015/02/05/rename-a-local-and-remote-branch-in-git/

Rate this blog entry:
JQuery Validate Single Input on Toggle
Git Push Error - 401 Unauthorized While Accessing....

Comments

 
No comments yet

Latest Comments

Susan Hermiston Virtual Hosts
October 7, 2015
Wow 747 just blew me away. Sorry not a tech person at all!! But I still love you!! Rock on!!?
Johmny Invisible Mouse Cursor Ubuntu & Synergy
September 2, 2015
Glad I was ble to help!
Kristian Falk Invisible Mouse Cursor Ubuntu & Synergy
September 1, 2015
Thank you for this! Had the exact same problem. I almost went crazy.