Rename a branch locally and remotely in Git

1
2
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Script to rename a branch locally and remotely in Git.

#Git #Bash #Branch #cesarnog

2 Responses

Thanks for your snippet
@Henry You are welcomed Henry

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.