3.5. Collaborative coding with GitHub

Building reproducible research projects.

About these materials

Welcome! This workshop is intended to introduce learners to the essential skills for collaborating on shared projects using GitHub and RStudio. It will guide learners step‑by‑step through the core parts of a collaborative GitHub workflow, including how to navigate GitHub’s interface, fork and clone repositories to work locally, and use Git commands to commit, push, and pull changes. Simultaneously, this workshop prepares learners to actively use reproducible research practices and how to design a simple collaborative workflow that keeps everyone’s work synchronized and traceable.

Who are these materials for?

The target audience of this workshop is twofold:

  • Self-learners with prior experience with R and version control, who are interested in developing their skills on the topic. You can follow the materials by chronologically going through the slides and following along the practical exercises. You go at your own pace and within your own timeframe. Presenter notes will help you to understand and reflect on the content of the materials. Note: Group exercises are not possible in this asynchronous setting.

  • Instructors in higher education (e.g., universities, colleges) aiming to convey the content of these materials to their learners in a synchronous (in-person, virtual or hybrid) class-room setting. The slides can be directly presented in full screen below, with speaker and instructor notes providing detailed information about the content of the materials and valuable pedagogical tips how to convey the materials to your learners. You can also download the PowerPoint corresponding to the materials below and adapt the materials to your learners. Make sure to give appropriate credit to the original authors.

Prerequisites

Prerequisite Description Where to find it
R and RStudio installed Latest versions of both R and RStudio https://posit.co/download/rstudio-desktop/
Basic R skills 3.2. Introduction to R - Part I Module 3.2.
Advanced R skills 3.3. Introduction to R - Part II Module 3.3.
Basic Git skills 3.4. Introduction version control (Git) with RStudio Module 3.4.
GitHub account Create a personal account on GitHub github.com
Practice GitHub repo Fork the LMU OSC Collaborative-RStudio-GitHub repository to set up a practice repository for the exercises in this lesson See next slide

Learning objectives

  • Navigate GitHub to collaborate on shared projects.
  • Fork and clone repositories to work locally without altering the main branch.
  • Commit, push, and pull changes to keep your project tracked and synchronized.
  • Design a collaborative workflow that enhances the openness and reproducibility of your own projects.

Materials

Click here to see the materials in full Screen

Download files

Practical exercises - solutions

Download the solutions for the practical exercises here:

Helpfiles

Download the csv file for the example data:

Export slides

You can export these slides as PowerPoint by pressing the button below. Note that basic formatting will be applied. MAKE powerpoint template to use for export.

Contributors and licence details

Creator: Waterfield, Elizabeth (orcid logo0009-0006-3725-6730)

Reviewer: von Grebmer zu Wolfsthurn, Sarah (orcid logo0000-0002-6413-3895)

Consultant: Ihle, Malika (orcid logo0000-0002-3242-5981)


CC BY 4.0

This work was originally created by Anna Krystalli from RSE-Sheffield under a MIT licence (original repository). It was subsequently adapted by Malika Ihle during her time at Reproducible Research Oxford, with the contributions of Adam Kenny. This work by Elizabeth Waterfield, Sarah von Grebmer zu Wolfsthurn, and Malika Ihle is licensed under a CC-BY-SA 4.0 Creative Commons Attribution 4.0 International SA License. It permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited. If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.