question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

convert master branch to main for OSS site + enable `develop` branch protection

See original GitHub issue

to comply with our branch naming conventions we should change these branch names and also enforce some simple branch protection on the develop branch

Acceptance Criteria

  • change master to main

A nice how to: https://stevenmortimer.com/5-steps-to-change-github-default-branch-from-master-to-main/

Branch rules:

  • require pull request before merging > with 1 approver
  • Dismiss stale pull requests approvals where new commits are pushed
  • include administrators

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rudouglascommented, Apr 30, 2021

Created new Branch protection rule for develop with following:

  • Require pull request reviews before merging
    • Required approving reviews: 1
    • Dismiss stale pull request approvals when new commits are pushed
  • Include administrators

Change master to main

Steps needed
  • Create main branch locally, taking the history from master
    • git branch -m master main
  • Push the new local main branch to the remote repo (GitHub)
    • git push -u origin main
  • Connect main branch to Amplify
  • Switch site to build from the main branch instead of master in Amplify
  • Check Workflows for actions that involve master branch and change those to main
  • Delete the master branch on the remote
    • git push origin --delete master
0reactions
rudouglascommented, Apr 30, 2021

As we are opening a fresh ticket to look at the impact of removing master i’ll close this out

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing the default branch - GitHub Docs
Changing the default branch · On GitHub.com, navigate to the main page of the repository. · Under your repository name, click Settings. ·...
Read more >
Protected branches - GitLab Documentation
To protect a branch: On the top bar, select Main menu > Projects and find your project. ... To protect a new branch...
Read more >
5 steps to change GitHub default branch from master to main
Step 1 - Move the 'master' branch to 'main' · Step 2 - Push 'main' to remote repo · Step 3 - Point...
Read more >
Protecting the master branch
In your repository navigation to Settings > Branches · Under “Protected Branches” select master · Enable the following settings: Protect this branch; Require...
Read more >
remote: GitLab: You are not allowed to push code to protected ...
You can turn on and off protection on selected branches in Project Settings (Go to project: "Settings" -> "Repository" -> "Expand" on "Protected...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found