Difference Between Main Branch and Master Branch in Github?

GitHub is working on replacing the term "master" on its service with a neutral term like "main" to avoid any unnecessary references to slavery,

you can read here for more background the reason for the change https://www.zdnet.com/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/

about renaming your branch from master to main: there are a lot of guidelines for example here https://jarv.is/notes/github-rename-master/

git branch -m master main
git push -u origin main
git remote set-head origin main


They just changed the default branch for new repositories. You can also set it back to master here -> https://github.com/settings/repositories


The main branch has already replaced all new github repos as the main branch. You can read up on it here. There is no actual difference between main and master, it's just the name of the default branch.

For you git push origin master just creates a new branch called master (since it doesn't exist already) and pushes your current commits there.

Tags:

Git

Github