Skip to content

How do I change my local repository master branch to main? #944

Answered by glemieux
glemieux asked this question in Q&A
Discussion options

You must be logged in to vote

TL;DR:

git branch -m master main
git fetch <repo remote name>
git branch -u <repo remote name>/main main
git remote set-head <repo remote name> -a

Step-by-step explanation:

The following assumes that the user has cloned the NGEET repository and have not changed the master branch name already. The <repo remote name> below defaults to origin unless you have changed it to something different (using git remote rename command). To check the name of the remote associated with NGEET, run the git remote -v command and look for the name associated with the NGEET/fates.git address.

  1. Rename your local master branch to main: git branch -m master main
  2. Get the latest updates from the NGEET repository: g…

Replies: 1 comment

Comment options

glemieux
Nov 22, 2022
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by glemieux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant