The following steps may be used to rename your "master" branch to "main" on GitHub.
Use the following commands from a command-prompt.
git checkout master
git branch -m main
git push origin -u main
- Navigate to your project's repository on GitHub.
- Click the Settings tab along the top.
- Click Branches in the left menu.
- Change the dropdown from
master
tomain
and click Update. git push origin --delete master
Note, be sure to check any hyperlinks or screenshot urls in your repo that might be pointing to files on the old branch name and update the urls.