GitHub — Master to Main

If you haven’t heard yet and are used to GitHub’s “master” default branch, it may be a bit confusing at first when connecting your GitHub repository to your local project using the Git Bash console in the Git environment. As of October 1, 2020, by default GitHub has officially changed the term “master” to “main”: https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/

So, when setting up your project to connect Git to GitHub, you may get this error:

This is however an easy fix. You can rename your default branch to anything you want. Including “main” as seen here using this command which GitHub is now accustom to:

Rename “master” to “main” for GitHub

Note: It’s important to keep in mind your other working projects using “master” as the default name. Doing this change at the beginning of the project would be best to avoid conflicts. Then, once you change your default branch name, you can just use “main” from now on and GitHub should now know what default branch you are referring to:

If you want to check your branches you can use the command “git branch”:

Or you can also check your online GitHub account:

Learning more so hope this was helpful for folks who may find themselves stuck. Talk to you more about my findings!

Passionate animator and game developer; Wesley is a co-founder for Multivarious Games and a Creative Director in elearning at Xcelerate Media.