Replacing master with main in Github

Folgendes habe ich auf gefunden von Alexis Moody

Step 1 – Update Local

$ git branch -m master main
$ git push -u origin main

So what are we doing here? First with the -m command we are moving the git history from master to a new branch called main. Next we’re pushing the main branch up to the origin remote, and establishing an upstream connection with the -u command.

Step 2 – Update Repo

  • Navigate to your repository > Settings > Branches
  • Select main as your default branch
  • Update your branch protection rules
  • Navigate to Code > Branches and delete master