2. Setting up Git

Configuring default branch name

There is one last thing to configure before we can start working with Git: setting the default branch name.

In the past, the universal default used to be master. However, in 2020, GitHub, GitLab, Bitbucket, and other platforms started to change the default name to main. This was done to remove any connotations of slavery from otherwise neutral terms.

As someone who grew up amid the ruins of the Soviet Union, watching too many Kung Fu movies, I can attest that the term master doesn't necessarily have negative connotations.

However, it's really easy to change the default branch name in Git. So if this change helps someone feel more comfortable, I'm all for it.

If anything, it will help avoid confusion when working with remote repositories hosted on popular platforms like GitHub.

To change the default branch name to main, run the following command in your terminal:

Run in Terminal:
git config --global init.defaultBranch main
Task

Set your default branch name to main using the command above.

Great! Everything seems to be ready now.

Next step
Wanna try the Story mode?
Take the course as it was meant to be taken: bite-sized progression, focused linear order, gradually unlock Gitopedia entries. Continue with real Git in VS Code/Cursor at any time.
Story mode
FREE
but requires sign-in
© 2024-2026 GitByBit.All rights reserved.