Description
The default for new repositories is now "main", so renaming might make contributing less confusing to newcomers.
scikit-learn have made this move (see issue and PR), and from https://github.com/github/renaming it doesn't look too disruptive:
Renaming a branch will:
- Re-target any open pull requests
- Update any draft releases based on the branch
- Move any branch protection rules that explicitly reference the old name
- Update the branch used to build GitHub Pages, if applicable
- Show a notice to repository contributors, maintainers, and admins on the repository homepage with instructions to update local copies of the repository
- Show a notice to contributors who
git push
to the old branch- Redirect web requests for the old branch name to the new branch name
- Return a "Moved Permanently" response in API requests for the old branch name
From the penultimate bullet point above, it seems that existing links in the docs wouldn't break even if we didn't update them, but I think the
push:
branches: [master]
part of the CI workflows would still need renaming.
For contributors
The GitHub interface will typically explain what you need to do as contributor to a project that changed the default name, but putting it here as well (copying the instructions from dask dask/dask#7199).
What you'll see
Once the name on github is changed, when you try to git pull
you'll get
Your configuration specifies to merge with the ref 'refs/heads/master'
from the remote, but no such ref was fetched.
What you need to do
First: head to your fork and rename the default branch there. When visiting https://github.com/<USERNAME>/pandas
, you will see a notice like this:
where you can click this link (https://github.com/<USERNAME>/pandas/settings/branches
), and then rename "master" to "main"
Then, locally run:
git checkout master
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a