Closed noureddin closed 1 year ago
I found a related issue: #1462
GitHub and GitHub now create a main
branch for you when you create a new repository from their interface.
I don't know when the Git program will make main
the default branch when you run git init
.
I guess when the book was written the libgit2
repo used master
, and they migrated to main
some time after the book was written. 😉
Changes
Add a note in Ch02 > Recording Changes to the Repository > Checking the Status of Your Files, directly after the paragraph that says:
The note points out that remote repositories are likely to have a different default branch name.
Context
GitHub in mid-2020 changed the default branch name from
master
tomain
, and so did other Git hosts. And many developers use an even different default branch name likedev
ordevelop
or something else.A beginner might be very confused when seeing a repo whose default branch is not
master
. So I think it worth pointing out that explicitly.I mean, the book asserts that the default branch is always
master
, when explaining thegit status
output in a freshly cloned repo. That repo is libgit2, whose default branch ismain
…