Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Default branch 'master' is now 'main' #165

Discussion options

More info here about updating your local clones:
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch#updating-a-local-clone-after-a-branch-name-changes

If you use the main repo as your origin:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
git remote prune origin

If you use a forked repo as your origin, first sync and rename the branch in the forked repo, then:

git branch -m master main
# repoint upstream
git fetch upstream
git branch -u upstream/main main
git remote set-head upstream -a
git remote prune upstream
# repoint origin
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
git remote prune origin
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /