Skip to content

Instantly share code, notes, and snippets.

@Kilo-Loco
Created June 15, 2020 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kilo-Loco/f22b8da20c68f6e1f60d59f196e64140 to your computer and use it in GitHub Desktop.
Save Kilo-Loco/f22b8da20c68f6e1f60d59f196e64140 to your computer and use it in GitHub Desktop.
How to rename master to main with Git
git branch -m master main
git push -u origin main
git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
git branch -u origin/main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
git push origin --delete master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment