Update section on system and global configuration of Git#201
Update section on system and global configuration of Git#201alex-ball wants to merge 5 commits intoLibraryCarpentry:mainfrom
Conversation
These comments are known to apply to Ubuntu, other distros may vary.
Thank you!Thank you for your pull request 😃 🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}. If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
Rendered Changes🔍 Inspect the changes: https://github.com/LibraryCarpentry/lc-git/compare/md-outputs..md-outputs-PR-201 The following changes were observed in the rendered markdown documents: What does this mean?If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation. ⏱️ Updated at 2026-03-06 11:33:43 +0000 |
Closes #164.
In episode 2, learners are asked to inspect their current Git configuration with
git config --list. This re-formats and concatenates the contents of the systemgitconfigand the user's globalgitconfig(and then any repo- or folder-specificgitconfigfiles that apply).As research for this, I looked at a recent installation of Git on a macOS system, and also performed fresh installations on Windows following the instructions for installing the shell as of 2026-02-25.
I have updated the macOS output to reflect the contents of the system config that was installed at
/Library/Developer/CommandLineTools/usr/share/git-core/gitconfig.I have updated the Windows output to reflect the contents of the system config at
C:\Program Files\Git\etc\gitconfigfollowing the above instructions with the Git for Windows v2.53.0 installer. In relation to issue Do we need to set branch name to main? #164, note that the instructions say "Let Git decide" on the default branch name, which setsinit.defaultbranch=master(reflecting Git's internal default).The fresh installation of Ubuntu (24.04 LTS) on WSL 2 did not ship with a system
gitconfig. This reflects my experience with regular installations of Ubuntu and other distributions based on it. Because of this,git config --listyields no output; I have added a paragraph to reflect this.The instructions for installing Git for Windows include selecting Nano as the
core.editorin the system config. I am unhappy about telling people who have done this to select it again. I have therefore expanded the callout about text editors to include a discussion of the relative merits of Nano and Vim, and mention that Nano may already be set as default. The comment about cross-platform availability sits better there. I have allowed some repetition of points made before the callout (about Vim being hard at first) and after (about Nano running in the shell) – I think the discussion inside the callout would be incomplete without those points, and those who skip the callout still need to see them – but I'm open to persuasion on that point.Finally, I have changed the emphasis of the part about the default branch from setting it to ensuring it, acknowledging that it may already be set to
main. I have also added a callout explaining why repeating the setting in your own global config could nevertheless be useful.