Skip to content

Commit 3934272

Browse files
authored
Merge pull request #1729 from noureddin/new-default-branch-name
Note that master is not always the default
2 parents 2741905 + 1b64de1 commit 3934272

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ 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+
[[_default_branch]]
8788
==== Your default branch name
8889

8990
By default Git will create a branch called _master_ when you create a new repository with `git init`.

book/02-git-basics/sections/recording-changes.asc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ Finally, the command tells you which branch you're on and informs you that it ha
3636
For now, that branch is always `master`, which is the default; you won't worry about it here.
3737
<<ch03-git-branching#ch03-git-branching>> will go over branches and references in detail.
3838

39+
[NOTE]
40+
====
41+
GitHub changed the default branch name from `master` to `main` in mid-2020, and other Git hosts followed suit.
42+
So you may find that the default branch name in some newly created repositories is `main` and not `master`.
43+
In addition, the default branch name can be changed (as you have seen in <<ch01-getting-started#_default_branch>>), so you may see a different name for the default branch.
44+
45+
However, Git itself still uses `master` as the default, so we will use it throughout the book.
46+
====
47+
3948
Let's say you add a new file to your project, a simple `README` file.
4049
If the file didn't exist before, and you run `git status`, you see your untracked file like so:
4150

0 commit comments

Comments
 (0)