git checkout -b release master # Create and switch to the release branch
git push -u origin release # Push the release branch to the remote and track it
git branch -d master # Delete local master
git push --delete origin master # Delete remote master
git remote prune origin # Delete the remote tracking branch
Please note, if you are using GitHub you will need to first change your “default” branch on GitHub after step 3:
In your repository on github.com go Settings → Branches → Default Branch. Change it to release and then do the rest of the steps.