merely-useful / py-rse

Research Software Engineering with Python course material

Home Page:http://third-bit.com/py-rse/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal: Add section for `git config --global init.defaultBranch main`

jmbuhr opened this issue · comments

Proposal

I am currently reading through your book and very much enjoying it!
With the software community moving away from the outdated and charged default name master for the first git branch, you might want to add a paragraph about this to the book. This will
a) help normalize main as the default branch and
b) lead to less confusion for new users when they find that the default branch for GitHub is already main, but their local git used master.

See: https://github.com/github/renaming.
The official git documentation also states that the current default branch name is "currently master, but this is subject to change in the future; the name can be customized via the init.defaultBranch configuration variable" (https://git-scm.com/docs/git-init), so there might be some changes down the line.

Realized that the change is covered in the advanced git chapter, but maybe it could be moved to earlier, where master is first mentioned.

Thanks so much for filing the issue, @jmbuhr ! The default parameters and messages in git changed during the course of the book (in some cases dramatically), and you've identified one of the places in which we needed to make decisions about what to explain and where the explanation should occur in the context of the package development process-- especially since not everyone is going to be running the most current version of git!

Given that, I think this is a great solution for the first round of book revisions, as it would ensure everyone has similar code to run (regardless of their version).

I can imagine this must be so hard with the pace at which the software landscape is changing. You are doing a great job! I just finished that last chapter and especially liked how you motivated every chapter and step along the way with the real world example.

Maybe a change is not entirely necessary, because GitHub also makes users change the branch name when creating a repository and copy-pasting the code they provide:
image