• Home
  • About
  • Schedule
  • Sessions
  • Git @ ZI
  • Code of Conduct

Contents

  • This session
  • Learning objectives
  • recipes project
  • Exercises
    • Configure Git
  • Slides
  • Cheatsheet

Setup & Configuration of Git

Session 03

Starts at:

Wednesday, 15th of January 2025, 15:30

Slides Chapter: Installation Chapter: Setup

This session

In this session, you will work on the following tasks:

  1. Reading: Read the chapter(s) “Setup” (and “Installation”, if needed) in the Version Control Book.
  2. Implementation: Try out the commands in the chapter.
  3. Exercises: Work on the exercises for the recipes project.
  4. Quiz: Test your knowledge with the quiz.

As always:

  1. Try out the commands of this session and play around with them.
  2. Check whether you have achieved the learning objectives.
  3. Ask questions!
  4. Let’s git started!

Learning objectives

At the end of this session, you should be able to answer the following questions and / or achieve 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:

  1. You set up Git.
  2. You configured Git.

Please keep the recipes folder! We will continue to use it in the following sessions.

Exercises

Configure Git

  1. If needed, navigate into the project folder using the command line.
  2. Set your Git username.
  3. Set your Git email address.
  4. Change the default name of the initial branch to main
  5. 🚀 Optional: Change your default text editor.
  6. List the Git configuration settings.

Slides

How can I download the slides as a PDF file?

To export the slides to PDF, do the following:

  1. Toggle into Print View using the E key (or using the Navigation Menu).
  2. Open the in-browser print dialog (CTRL/CMD+P).
  3. Change the Destination setting to Save as PDF.
  4. Change the Layout to Landscape.
  5. Change the Margins to None.
  6. Enable the Background graphics option.
  7. Click Save.

Note: This feature has been confirmed to work in Google Chrome, Chromium as well as in Firefox.

Here’s what the Chrome print dialog would look like with these settings enabled:

Screenshot of Chrome print dialog with the first slide/page of 43 shown on the left, and print options on the right. The Destination print option has Save as PDF selected.

These instructions were copied from the Quarto documentation (MIT License) and slightly modified.

Cheatsheet

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
© 2025 Dr. Lennart Wittkuhn
 
License: CC BY 4.0