Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename GitHub branches from master to main #427

Open
1 of 38 tasks
choldgraf opened this issue Jul 9, 2021 · 1 comment
Open
1 of 38 tasks

Rename GitHub branches from master to main #427

choldgraf opened this issue Jul 9, 2021 · 1 comment

Comments

@choldgraf
Copy link
Member

choldgraf commented Jul 9, 2021

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 jupyterhub/zero-to-jupyterhub-k8s#2217

  1. Check that master is the default GitHub repo branch. If it's not you probably don't need to do anything 😃
  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
Copy link
Contributor

bsipocz commented Apr 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants