git config --global init.defaultBranch main
xxxxxxxxxx
git config --global init.defaultBranch main
Change the branch name inside GitHub Web first, then:
xxxxxxxxxx
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
before: master
after: main