Today I spent about an hour renaming the
master branch to
main on all my personal repositories.
This included around 100 repos in GitHub, Bitbucket and Azure DevOps.
To be clear, I don't think this is going to be the thing that fixes racism in our society.
I've heard people (mostly on Twitter) argue against this change, however:
It seems that most people are settling on
main as the replacement for
If you'd like to make such changes to your repositories, the general steps are:
mainand make sure it is based off of
master, switch it over to
mainas your main/default branch
git pullfollowed by
git checkout main
Below are some screenshots and specific details of the three platforms I use:
You can create a new branch in Github directly on the main "code" page of the repo:
If you have any open pull requests, you'll need to edit them and switch the base branch to
You can find a link to change the default branch on the "branches" page of your repo:
You can create a new branch in Bitbucket here:
Pull Request target branch will need to be changed here:
The main branch can be updated under the repository's settings:
In Azure DevOps you can create here:
You can then change the default branch here:
That's all there is to it!