Configuring default branch name
There is one last thing to configure before we can start working with Git: the default branch name.
In the past, the 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 make the language of Git more inclusive and to remove any connotations of slavery from otherwise neutral terms.
Let's set the default branch name to main
in our Git configuration to avoid any confusion with the GitHub's defaults in the future.
git config --global init.defaultBranch main
Set your default branch name to main
using the command above.
Hi! I'm Alex, creator of GitByBit.
This page is a part of the interactive course about Git version control.
It's a one-of-a-kind course that is integrated into the VS Code code editor. Learning directly in VS Code lets you operate Git exactly as you would in real life, doing real jobs, writing real code.
In addition, the course has access to your actual terminal, so it can point out mistakes, suggest workarounds, etc.
The course is FREE, there are no Ads or other bullshit. There are optional premium add-ons you can purchase, mainly to support my work (regrettably, I have to eat every day), but that's totally up to you.