For those who would like to change the default master branch in GitHub to something else, here using main instead:
- Make sure you're up-to-date:
git checkout master; git fetch; git pull
- Rename the branch:
git branch -m main
- Push the change:
git push -u origin main
- No PR is needed
- In the GitHub UI for the REPO being changed: Settings → Branches → Default branch
- Select main from the drop-down menu, click Update
- Browse to https://github.com/USER/REPO/branches
- Click the red trashcan next to master