How to rename a Git branch locally and remotely

With a simple few steps you can easily rename your Git branch locally and remotely on Github as well. Here are the steps:

git branch -m old_branch new_branch # Rename branch locally git push 
origin :old_branch # Delete the old branch 
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.