Created
November 1, 2021 01:00
-
-
Save klaasnicolaas/ace431c533dc956165e31c434a18cfce to your computer and use it in GitHub Desktop.
Master branch to main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 1 | |
# create main branch locally, taking the history from master | |
git branch -m master main | |
# Step 2 | |
# push the new local main branch to the remote repo (GitHub) | |
git push -u origin main | |
# Step 3 | |
# switch the current HEAD to the main branch | |
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main | |
# Step 4 | |
# change the default branch on GitHub to main | |
# https://docs.github.com/en/github/administering-a-repository/setting-the-default-branch | |
# Step 5 | |
# delete the master branch on the remote | |
git push origin --delete master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment