Switch from master to main as primary branch
nzakas opened this issue · comments
Nicholas C. Zakas commented
- GitHub: Merge any outstanding pull requests
- Local: Ensure you're up-to-date locally
git fetch && git reset --hard origin/master
- Local: Push a
main
branch:git checkout -b main && git push origin main
- GitHub: Under Settings -> Branches: Set the default branch to
main
- GitHub: Under Settings -> Branches: Set up branch protection for the
main
branch - GitHub: Under Settings -> Branches: Remove branch protection for
master
- Local: Delete remote master branch
git push origin :master
- Local: Delete master branch
git branch -d master
Nicholas C. Zakas commented
Completed using GitHub's branch rename tool
唯然 commented
seems some repos are still using master. e.g. eslint/eslint, eslint/website
Nicholas C. Zakas commented
Yes, we are slowly working our way through. Both of those repos have a lot of functionality that needs to be reviewed and changed, so we are starting with the easy repos first.
唯然 commented
so should keep it opened - to make sure we don't lost track of this?