Changing the Default Branch from Main to Master on GitHub
In empty repositories
git branch -M master# Make your initial commitgit commitgit push -u origin master
In non-empty repositories
Navigate to your repository on GitHub and follow these steps:
- Go to your repository's main page
- Click on Settings (requires admin access)
- Under "Default branch", click the switch icon or pencil icon
- Type master in the textbox
- Click Rename branch