How to Create New Github repositories: Using “main” as the Default Branch

Sandie Nuñez
2 min readApr 8, 2021

On October 1 2020, Github officially changed the way to create new repositories. Github changed the name of their repositories from “master” to “main” in order to combat offensive and derogatory language that evokes references to slavery. This shows Github’s commitment to be a more inclusive company that cares about using non-offensive language and commands to be more inclusive of all people including the black community. This shift is part of a huge effort in the tech community to steer away from using use divisive and racist language such as coding terms that include whitelisting, blacklisting and master.

Microsoft, IBM, Twitter, Red Hat, MySQL, the Linux kernel, and OpenBSD are a few of the companies and open source projects that have promised to make positive changes to their coding terms. Github announced that it will be possible to rename your default branch to main for existing projects you have made in the past without any issues.

As I started creating my new portfolio project for my Rails and Javascript project, I ran into issues when trying out the previous version. Here are the steps to easily rename your branch with the amazing new change to “main.”

Renaming the default branch name of your repository with “main.”

The image below shows you what you should get back after the last command.

--

--