| Command | Description |
|---|---|
git config |
Get an overview of Git config commands |
git config --global user.name "user.name" |
Sets Git username |
git config --global user.email "user.email" |
Sets Git email address |
git config --global core.editor "editorname" |
Sets Git text editor |
git config --global init.defaultBranch main |
Sets default branch name to main |
git config --list |
Views set Git configurations |
This session
In this session, you will work on the following tasks:
- Reading: Read the chapter(s) ?meta:chapter in the Version Control Book.
- Implementation: Try out the commands in the chapter.
- Exercises: Work on the exercises for the
recipesproject.
As always:
- Try out the commands of this session and play around with them.
- Check whether you have achieved the learning objectives.
- Ask questions!
- Letβs git started!
Learning objectives
At the end of this session, you should have achieved the following learning objectives:
π‘ You know how to set up Git for the first time
π‘ You have set up Git on your computer
π‘ You understand the difference between the three Git configuration levels
π‘ You know how to configure your username and email address in Git
π‘ You have set up your preferred text editor when working with Git
π‘ You can escape the command-line text editor Vim
recipes project
At the end of this session, you should have accomplished the following:
- You set up Git.
- You configured Git.
Please keep the recipes folder! We will continue to use it in the following sessions.
Exercises
Configure Git
- If needed, navigate into the project folder using the command line.
- Set your Git username.
- Set your Git email address. This email address will appear in your Git history, so use an address you are comfortable sharing.
- Change the default name of the initial branch to
main. - π Optional: Change your default text editor.
- List the Git configuration settings.
Slides
To export the slides to PDF, do the following:
- Toggle into Print View using the E key (or using the Navigation Menu).
- Open the in-browser print dialog (CTRL/CMD+P).
- Change the Destination setting to Save as PDF.
- Change the Layout to Landscape.
- Change the Margins to None.
- Enable the Background graphics option.
- Click Save.
Note: This feature has been confirmed to work in Google Chrome, Chromium as well as in Firefox.
These instructions were copied from the Quarto documentation (MIT License) and slightly modified.