I haven't tried this myself, but these are the supposed steps to do this:
# Move the master branch to main.
$ git branch -m master main
# Push the new "main" branch to GitHub.
$ git push -u origin main
# Point HEAD to main.
$ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
# Log in to GitHub , open the repository, and click Settings > Branches.
# Select "main" as your default from the drop-down.
# Click "Update" and when prompted, click "I Understand".
# Delete the "master" branch.
$ git push origin --delete master
PS There may be more things to change that I'm not aware of, such as build/release scripts.
Context: https://github.com/github/renaming
I haven't tried this myself, but these are the supposed steps to do this:
PS There may be more things to change that I'm not aware of, such as build/release scripts.