Rename GitHub branches from master to main
Background
GitHub recently changed its behavior to use main as the default branch instead of master. We had a quick Slack discussion about this and decided it was best to rename our repositories to use main since that will quickly become the new standard to across OS projects. This is an issue to keep track of the projects that we should convert over, using a workflow that was created by the JupyterHub community.
Workflow
This suggested workflow is based on jupyterhub/jupyterhub#3462 and https://github.com/jupyterhub/zero-to-jupyterhub-k8s/pull/2217
- Check that
masteris the default GitHub repo branch. If it's not you probably don't need to do anything :smiley: - Replace
masterwithHEADin all URLs pointing to a JupyterHub GitHub file or directory:https://github.com/jupyterhub/.+/(blob|tree)/master/.* - Optionally replace
masterwithHEADin GitHub URLs for non-JupyterHub repos (only do this ifmasteris the default branch, it usually is but that's not guaranteed) - Update CI workflows that reference the
masterbranch. If they mentionmasterandmainremovemasterto avoid problems if someone inadvertently pushes a newmasterbranch - Update references to
masterbranches in docs - Open a PR with using this template (edit as required):
Actions to take, in order:
- [ ] approve this PR
- [ ] rename the `master` branch to `main` in GitHub (this should automatically update all PRs)
- [ ] merge this PR
- [ ] check the publish workflow publishes the expected outputs if relevant
- [ ] If readthedocs.org is used, set main as the default branch explicitly: admin -> advanced -> default branch
`$ git grep master`
# Include the above output to help reviewers. If any mentions of `master` aren't obvious add an explanation.
Active repos with a default master branch
Obtained with https://gist.github.com/manics/6c8b88b191fae7dcf7a8a8cc5fc3cdc9 and modifying the org to be executablebooks.
- [ ] https://github.com/executablebooks/.github
- [ ] https://github.com/executablebooks/MyST-NB
- [ ] https://github.com/executablebooks/MyST-Parser
- [ ] https://github.com/executablebooks/github-action-demo
- [ ] https://github.com/executablebooks/github-activity
- [x] https://github.com/executablebooks/jupyter-book
- [x] https://github.com/executablebooks/jupyter-cache
- [ ] https://github.com/executablebooks/jupytext
- [ ] https://github.com/executablebooks/markdown-it-py
- [ ] https://github.com/executablebooks/mdformat
- [ ] https://github.com/executablebooks/mdformat-deflist
- [ ] https://github.com/executablebooks/mdformat-myst
- [ ] https://github.com/executablebooks/mdformat-plugin
- [ ] https://github.com/executablebooks/mdformat-tables
- [ ] https://github.com/executablebooks/mdit-py-plugins
- [x] https://github.com/executablebooks/meta
- [ ] https://github.com/executablebooks/multi-book-demo
- [ ] https://github.com/executablebooks/myst-language-support
- [ ] https://github.com/executablebooks/myst-nb.example-project
- [ ] https://github.com/executablebooks/myst-parser.example-project
- [ ] https://github.com/executablebooks/python-pkg-cookiecutter
- [ ] https://github.com/executablebooks/quantecon-example
- [ ] https://github.com/executablebooks/quantecon-mini-example
- [ ] https://github.com/executablebooks/sphinx-book-theme
- [ ] https://github.com/executablebooks/sphinx-comments
- [ ] https://github.com/executablebooks/sphinx-copybutton
- [ ] https://github.com/executablebooks/sphinx-exercise
- [ ] https://github.com/executablebooks/sphinx-ext-autodoc
- [ ] https://github.com/executablebooks/sphinx-jupyterbook-latex
- [ ] https://github.com/executablebooks/sphinx-multitoc-numbering
- [ ] https://github.com/executablebooks/sphinx-panels
- [ ] https://github.com/executablebooks/sphinx-proof
- [ ] https://github.com/executablebooks/sphinx-tabs
- [ ] https://github.com/executablebooks/sphinx-thebe
- [ ] https://github.com/executablebooks/sphinx-togglebutton
- [ ] https://github.com/executablebooks/sphinx-tomyst
- [x] https://github.com/executablebooks/thebe
- [ ] https://github.com/executablebooks/web-compile
If you encounter trolls
There is a small but non-zero chance that trolls will put abrasive and negative comments in a PR that renames master to main. If this happens, just report their comment to GitHub and delete it. If it's somebody that has participated in an executablebooks repository before, report it to the team as a CoC violation as well.
some of these renames have already happened, e.g. for the https://github.com/executablebooks/meta repo