init.defaultBranch

The setting that chooses the name of the first branch in a newly created repository, such as main.

In more detail

Without it, older Git versions name the first branch master and print a hint suggesting you choose. Setting git config --global init.defaultBranch main makes every new repository start on main.

Example

git config --global init.defaultBranch main

Related terms

Taught in

References