Guides1 min read
Changing the Default Branch from Main to Master on GitHub
Change a GitHub repo default branch from main to master: local setup, CI/CD updates, and troubleshooting.

In empty repositories
git branch -M master
# Make your initial commit
git commit
git push -u origin masterIn 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
Related reading