Skip to content

Master vs Main

In one line

Main and master are both conventional names for the default branch. Main is the modern standard, replacing master for inclusive language.

In simple words

Historically, Git named the default branch master when you ran git init. In 2020, the Git community and major hosting platforms (GitHub, GitLab, Bitbucket) adopted main as the new default for inclusive language, avoiding the master/slave terminology.

Technically, there is no difference — both are just branch names. The default is configured by init.defaultBranch in your Git config. New repositories on GitHub default to main; older repositories may still use master.

When cloning or contributing to a project, check which name is used with git branch. Some commands and scripts may assume one name; always verify. You can rename with git branch -m master main to switch.

Example

bash
# Check current default branch name
git branch

# Rename master to main
git branch -m master main

# Set default for new repos
git config --global init.defaultBranch main

main and master are just names. main is the modern default.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary