Skip to content

Instantly share code, notes, and snippets.

@junhan-z
Last active February 6, 2021 08:40
Show Gist options
  • Save junhan-z/0357b7322e8f6357b4ad73cf2fdc7e90 to your computer and use it in GitHub Desktop.
Save junhan-z/0357b7322e8f6357b4ad73cf2fdc7e90 to your computer and use it in GitHub Desktop.
Change "master" branch to "main"
# rename local master branch to "main"
git branch -m master main
# push to remote branch as "main"
git push origin main:main
# go to github, change the default branch, which usually to be "master"
# delete remote "master" branch
git push origin --delete master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment