Skip to content

Commit e8c2fee

Browse files
authored
Merge pull request #1475 from HonkingGoose/feature/add-section-on-setting-default-branch
Create section: your default branch name after git init
2 parents 58e65f7 + 3ca66f2 commit e8c2fee

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

book/01-introduction/sections/first-time-setup.asc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ You may find, if you don't setup your editor like this, you get into a really co
8484
An example on a Windows system may include a prematurely terminated Git operation during a Git initiated edit.
8585
====
8686

87+
==== Your default branch name
88+
89+
By default Git will create a branch called _master_ when you create a new repository with `git init`.
90+
From Git version 2.28 onwards, you can set a different name for the initial branch.
91+
92+
To set _main_ as the default branch name do:
93+
94+
[source,console]
95+
----
96+
$ git config --global init.defaultBranch main
97+
----
98+
8799
==== Checking Your Settings
88100

89101
If you want to check your configuration settings, you can use the `git config --list` command to list all the settings Git can find at that point:

0 commit comments

Comments
 (0)