Renaming The Default Branch

Could you include instructions for us not-so-git-savvy folks that explain what we have to do locally? I know I have to rename my master branch. Do I have to do anything else?

Could you include instructions for us not-so-git-savvy folks that explain what we have to do locally? I know I have to rename my master branch.

Technically, you don’t have to rename your local branch; just run

git --set-upstream-to=origin/main master

I presume it's fine to first rename my local 'master' to 'main' and then do the --set=upstream-to?

Could you include instructions for us not-so-git-savvy folks that explain what we have to do locally? I know I have to rename my master branch. Do I have to do anything else?

Sorry Paul, my apologies for not responding to you earlier. I know there are many different ways in git to accomplish the same goal. This is the method I plan on using to update my local working copy of the repository:

In my local llvm-project directory:
$ git fetch origin
$ git checkout origin/main -b main

When you are ready to remove your local ‘master’ branch run:
$ git branch -d master

If someone else reading this would please peer review this, I would appreciate the assistance. If I can get a LGTM from someone I will add these steps to the webpage as well.

Thanks,
Mike

This should work, after you cherry-pick whatever is left in the master branch. To carry-over the current local master branch “as-is”, you can also just rename the master branch locally and update the tracking:

if not already on the master branch

$ git checkout master

Rename the branch locally

$ git branch -m main

Update the tracking so that git pull/git push lookup the remote main

$ git branch -u origin/main