

Nice job! One more step to get, we just need to get rid of the master branch so that the main branch is the only branch. Next, click the arrows to change the default branchĪfter the default branch change, you can go back to the main repo page and see that main is now the default branch. Enter in the URL of your remote repository in the New Remote Repository URL field and click on the Change Origin button. Scroll down to the Danger Zone and click on the Set Origin link. In the Git repository, click on the Settings tab.
SET ORIGIN AS MASTER GIT HOW TO
Then on the lefthand menu, click on branches In this article, we’ll show you how to set the new origin in Git. On the main page for your repo, click on settings. Your new origin will be set and you will be able to push/pull from your remote. In the code, the origin is your default remote repository name and -u flag is upstream, which is equivalent to -set-upstream.

We are going to change it so the default repo and the checkmark are next to the main branch. In the Git repository, click on the Settings tab. Removing this language from company vernacular is a small way to help make technology more accessible and inclusive to Black people. If you go to the main repo page on GitHub and select the branches dropdown menu, you will see two branches listed and a checkmark next to master. The origin of the term 'master' in computing is controversial, but email records from the Git developers confirm that they were referring to the common master/slave metaphor when the industry standard was set. You need to do this on GitHub, not on your local computer. You can see which branch you are on using the command below:Ĭhange the default branch on GitHub to main The first step is to create a new branch locally (on your computer) called main. Step 1Ĭreate a new main branch locally, taking the history from master So change all of your GitHub repo names to main. This is confusing and leads to creating new branches that you don't want. Is the master branch in charge of anything? Are other branches subservient to it? And a very practical reason is that since GitHub moved to use main as the default branch, you have to remember when to use git push origin main and when to use git push origin master on a repo-to-repo basis.
SET ORIGIN AS MASTER GIT DOWNLOAD
In addition, the name main just makes more sense. To fix this error, remove the following file YOURPROJECT/.git/refs/remotes/origin/master, and then run git fetch to download it again. Language in programming, like master, that supports symbols of racism has no place. The reason to use the name main as the default branch on Github and in your local git repos is that it's the right thing to do. Git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
