Skip to content

Instantly share code, notes, and snippets.

@cassidoo
Last active November 23, 2021 18:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cassidoo/65d3bd0997954aaaf12caa1e0faa440d to your computer and use it in GitHub Desktop.
Save cassidoo/65d3bd0997954aaaf12caa1e0faa440d to your computer and use it in GitHub Desktop.
Instructions for `master` to `main` branches

Switch master branch to main branch

Create main branch with history from master

git branch -m master main

Push main branch to GitHub

git push -u origin main

Switch HEAD to main

git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main

Change default branch on GitHub to main

Instructions here

Delete master 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