9  Git basics and setup

Since Git has already been covered in the introduction workshop, we won’t cover learning it during this workshop. However, since version control is a fundamental component of any modern and reproducible data analysis workflow and should be used, we will be using it throughout the workshop.

Important

If you have used or currently use Git, you can skip this section and move on to Section 9.1.

Git itself isn’t too difficult to use. But the concepts that Git uses are very difficult to learn and use. That’s because Git requires you to view your files and folders and computer very differently to how you may normally be used to working with them. And because we will be using Git throughout the workshop, to ensure you have the smoothest experience, we want you to at least be aware of and have read a bit about Git. So, from the introduction workshop, please read these sections:

  1. What is version control?
  2. What is Git?
  3. Basics of Git

After reading them, open up your RStudio and type out (or paste) this function in the R Console, then run it by pressing Enter. This function should open up a pop-up window to type in your name and email:

Console
r3::setup_git_config()

For most of the workshop, we will be using Git as shown in the Using Git in RStudio section. Later in the pre-workshop tasks in Chapter 11, you’ll read about GitHub and connect your project to it.

9.1 Confirming your Git setup

Since you will be using Git regularly throughout the workshop, please run this check to ensure everything is setup correctly. Type and run this function in the R Console of RStudio:

Console
r3::check_setup()

The output you’ll get for success should look something like this:

Checking R version:
✔ Your R is at the latest version of 4.5.0!
Checking RStudio version:
✔ Your RStudio is at the latest version of v2025.05.1+513!
Checking Git config settings:
✔ Your Git configuration is all setup!
  Git now knows that:
  - Your name is 'Luke W. Johnston'
  - Your email is 'lwjohnst@gmail.com'

Eventually you will need to copy and paste the output into one of the survey questions.