Git rename branch on remote
10+ years most with Ruby on Rails and JavaScript frontend and some Go. My first language is C for 3 years in university.
It's impossible ... but, you can copy a branch then delete the old one.
On the remote named origin (the default name), copy the master branch in new main branch.
git push origin origin/master:refs/heads/main
To delete the old master branch (the : means delete)
git push origin :master
FYI: the :master part, from the second command, can be put at the end of the first command to have a one line command.
