Git Rename Master to Main

Nov 18, 2020

NOTE: Read https://github.com/github/renaming before proceeding

Rename local branch to main

git branch -m master main

Check current branch name

git status
On branch main
Your branch is up to date with 'origin/master'.

Change GitHub default branch to main

  • Click on Settings -> Branches or https://github.com/[USERNAME]/[REPO]/settings/branches
  • On Default branch, switch to main and click update

Delete remote branch

git push origin --delete master

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.