Skip to content

Instantly share code, notes, and snippets.

@cassidoo
Last active February 6, 2025 20:16
Show Gist options
  • Select an option

  • Save cassidoo/65d3bd0997954aaaf12caa1e0faa440d to your computer and use it in GitHub Desktop.

Select an option

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