Learning Goal

  • Familiarize with the main tools of version control with git using RStudio’s graphical user interface.
  • Practice creating a new project with RStudio GUI.

Learning Objectives

Following this lesson, students will be able to:

  • Explain what is version control and why should we use it in research
  • Use Rstudio to:
    • create a new git repository locally
    • understand the concepts of “staging” and “committing” file versions
    • explain what is a hash
    • display, read and comprehend the git history

Day 1







Read: Best practices for commit messages

Day 2

Learning Goals

  • Learn git tools for version control of remote repositories on GitHub
  • Practice usage of Unix shell commands to set up and do remote version control on GitHub

Learning Objectives

Following this lesson, students will be able to:

  • Explain the difference between a local and a remote git repository
  • Create a new repository on GitHub
  • Set up git for usage with GitHub
  • push and pull changes to a remote repository
  • List alternative software to git for version control
  • List other platforms for remote version control with git
  • Explain why we use Git

Live coding



Group activity

  1. Read the comic, can you find three main differences between committing a change to a repository and pushing a change?
  2. Think of another example to illustrate the difference between git commit and git push. For example, I imagine that adding a song to my spotify queue is equivalent to committing a file, and then when the song is finally playing and made public that is like pushing the file to the remote repository 😜

A Git Story

Comic by Erika Heidi.

Optional activity

A difference between fetching and pulling.

Comic by Allison Hurst



Individual activity

  1. Create a remote repository called “bio” on your GitHub account.
  2. Add, commit and push your local repository to your newly created remote on GitHub.
  3. Add a line to your bio file using the GitHub GUI, and commit it.
  4. Modify another line of your bio on the GitHub GUI and commit it.
  5. Find the commit history on GitHub.
  6. Take a snapshot of the commit history displayed on GitHub and send it to your instructor.
  7. Now pull the changes into your local repository.
  8. Get your commit history on the terminal with git log, take a snapshot of it and send it to your instructor.