Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dharple
Last active February 11, 2023 13:48
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 dharple/79b51d1c2fc0fea64fb84659581a6dc9 to your computer and use it in GitHub Desktop.
Save dharple/79b51d1c2fc0fea64fb84659581a6dc9 to your computer and use it in GitHub Desktop.
Switch checkout from master to main

After renaming master to main on GitHub, run:

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

Use the first line to replace master with main in a private repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment