Introduction to Git and GitHub (RStudio) workshop summary

As recommended in the Better, Broader, Safer review NHSA 15. Embrace RAP and modern, open working methods version control and GitHub are recommended for intermediate and advanced analyst training. This course is an introduction to Git and using GitHub using RStudio as an IDE (integrated development environment) using the built in tools within RStudio and also with the packages {gert} and {usethis}.

This course will be run over two half days and is aimed at analysts who are familiar with RStudio and R, perhaps having completed the introduction to R and RStudio training through the MDSN or NHS-R Community.

Learning outcomes

  • Introducing Git and GitHub including getting set up
  • Exploring the tools built within RStudio IDE (integrated development environment) related to Git
  • Using the R Console to perform Git workflow tasks

Detailed Programme

Session 1

  • Prework - Get set up on a computer
  • Introduction - What is version control?
  • Version Control - What is Git/GitHub and how they relate to RStudio along with the ups and downs of Git
  • Workflow - Brief introduction to the Git and GitHub terminology
  • Workflow with {usethis} and {gert} - start work and making a commit

Session 2:

  • Pull Requests (PRs) - making pull request, pausing, resuming and finishing
  • Merge conflict! - repeat steps from previous session and create a conflict merge
  • Commit to main (and undo last commit!) - how committing is possible to the main and undo last commits
  • Undo last merge - undoing a merge (reverting a pull request)
  • Existing repositories - Getting copies of existing repositories

Pre-requisites

Some previous knowledge of R and familiarity with RStudio is expected.

Duration

2 half days (3.5 hours each day)

Course materials

Slides are published through GitHub.