Delete Git branch locally and remotely
git branch -d <branch_name>
git push -d <remote_name> <branch_name>
git branch -d <branch_name>
git push -d <remote_name> <branch_name>
master
to main
I read about GitHub renaming the default branch to something less offending to a lot of people. Sounds
like a no-brainer, som I decided to switch. My approach will be to simply create a new branch called
main
and mark it as default in GitLab. I won't go through all my repositoies at once, but
instead make the switch when I'm actively working on something.
My understanding is that the concept of a default branch is not a Git thing, but rather a Git Repository Thing. So this should be enough to make the switch:
git checkout -b main
git push --set-upstream origin main