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

refactor: rename Git master branch to main #5345

Merged
merged 12 commits into from Aug 17, 2021
Merged

Conversation

zpao
Copy link
Member

@zpao zpao commented Aug 11, 2021

Breaking changes:

  • For GitHub Pages organization deployments, docusaurus deploy does not assume anymore which Git branch is your default one, and it must be provided explicitly with the DEPLOYMENT_BRANCH env variable

We should transition over to the use of main as opposed to master, following a wider effort as we've seen by a number of projects in the React family.

This isn't a pure find+replace - I did my best to be precise here but I don't know project that well so it's possible there are mistakes.

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 11, 2021
.github/workflows/lint.yml Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
packages/docusaurus/src/commands/deploy.ts Outdated Show resolved Hide resolved
website/docs/guides/docs/versioning.md Outdated Show resolved Hide resolved
@netlify
Copy link

netlify bot commented Aug 11, 2021

✔️ [V2]

🔨 Explore the source changes: f857362

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61167f7039c88c0007183d65

😎 Browse the preview: https://deploy-preview-5345--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Aug 11, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 83
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5345--docusaurus-2.netlify.app/

@zpao zpao changed the title Prepare to renaming master branch to main Prepare to rename master branch to main Aug 12, 2021
@HonkingGoose
Copy link
Contributor

I have helped migrate a few big repositories to the main branch. So I can offer some advice to help you guys do the migration.

I recommend you read the docs on renaming branches to learn what GitHub will do for you, and what you need to do yourself.

https://docs.github.com/en/github/administering-a-repository/managing-branches-in-your-repository/renaming-a-branch


GitHub will do a lot of heavy lifting:

  • All existing PRs get re-targeted to the new main branch
  • People with forks can update their forks from the web interface on their forks "homepage"
  • Branch protection rules from master get copied to main
  • GitHub will redirect any old links that use master to main

The things you'll need to change/check yourself include:

  • GitHub Action references to branchnames
  • Build steps that need a specific branch name
  • Scripts
  • Other places where master is hard-coded

To benefit from GitHub doing the heavy lifting, you need to do the branchname changeover from within the GitHub Interface!

@slorber
Copy link
Collaborator

slorber commented Aug 12, 2021

Thanks

I'll sync with Joel to see how to make this happen, as I'm not a repo admin.

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zpao

I think we'll do the switch today so I'm going to follow up and complete this PR right now

@slorber slorber changed the title Prepare to rename master branch to main refactor: rename Git master branch to main Aug 13, 2021
@slorber slorber added pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: maintenance This PR does not produce any behavior differences to end users when upgrading. labels Aug 13, 2021
@slorber slorber merged commit 8341527 into facebook:main Aug 17, 2021
slorber added a commit that referenced this pull request Sep 3, 2021
* Prepare to renaming master branch to main

* Update CONTRIBUTING.md

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/package.json

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/package.json

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/package.json

* missing master -> main replaces

* useless char

* For GH Pages org deploy, DEPLOYMENT_BRANCH env is now required

* fix versioning page

* fix vercel links

* update deployment.mdx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants