executablebooks / meta

A community dedicated to supporting tools for technical and scientific communication and interactive computing
https://executablebooks.org
131 stars 167 forks source link

Rename GitHub branches from master to main #427

Open choldgraf opened 3 years ago

choldgraf commented 3 years ago

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

  1. Check that master is the default GitHub repo branch. If it's not you probably don't need to do anything :smiley:
  2. Replace master with HEAD in all URLs pointing to a JupyterHub GitHub file or directory: https://github.com/jupyterhub/.+/(blob|tree)/master/.*
  3. Optionally replace master with HEAD in GitHub URLs for non-JupyterHub repos (only do this if master is the default branch, it usually is but that's not guaranteed)
  4. Update CI workflows that reference the master branch. If they mention master and main remove master to avoid problems if someone inadvertently pushes a new master branch
  5. Update references to master branches in docs
  6. 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.

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.

bsipocz commented 1 year ago

some of these renames have already happened, e.g. for the https://github.com/executablebooks/meta repo