master and main
The default branch name.
In older tutorials and repositories, the main branch is called master. Since around twenty twenty, GitHub and most projects use main instead. They work exactly the same, it's just a name.

- Older repos use master
- Newer ones use main
- Just a name
Renaming a branch
If you have an old repository with master, you can rename it. Git branch dash m, master, main. List the branches, and it's now main. If it's on GitHub, you'd also rename it in the repository's branch settings.
git branch * master git branch -m master main git branch * main
Make main your default
To make every new repository start with main, set init dot default branch to main, once, in your global config. GitHub already uses main for new repositories. And when you join a project, just use whatever name it already has.
Summary
Master is the old name for the main branch. Rename it with git branch dash m. Next, a peek at how Git works inside.
Key takeaways- master = old name
- git branch -m
- init.defaultBranch main