← All STRAIT modules
TutorDA · STRAIT
Module B-C4

Version Control & Reproducibility

This module develops the version-control and reproducibility discipline that modern research software demands. Learners progress from Git fundamentals and branching workflows through collaborative platforms such as GitHub and GitLab, then on to containerisation, dependency pinning and the reproducibility of computational pipelines. The emphasis is on preserving provenance, enabling collaboration without conflict and producing analyses that a stranger can rerun from scratch. By the end, learners can take an existing analysis and refactor it into a version-controlled, environment-pinned project that others can clone, build and reproduce without assistance.

Learning Outcomes

1.
Record a project history with Git using commits, branches, tags and merges with clean commit messages.
2.
Resolve merge conflicts and recover lost work using the reflog, rebase and interactive history editing.
3.
Collaborate on shared repositories using forks, pull requests, code review and protected branches.
4.
Design branching workflows such as GitHub Flow and Git Flow and justify the choice for a given team.
5.
Pin computational environments using virtualenv, conda, pip-tools, Poetry or renv with lockfiles.
6.
Containerise analyses with Docker and reproduce them across operating systems.
7.
Assess an analysis against reproducibility criteria such as data provenance, seed control and build automation.
8.
Automate testing and build steps with continuous-integration pipelines (GitHub Actions or GitLab CI).

Topics Covered

Git object model: blobs, trees, commits and refs
Working tree, index and HEAD; the three-state model
Commits, atomic changes and conventional commit messages
Branches, fast-forward and three-way merges
Rebase, interactive rebase and when to rewrite history
Remotes, fetch, pull, push and tracking branches
GitHub and GitLab: pull/merge requests, code review and protected branches
Branching workflows: GitHub Flow, Git Flow, trunk-based development
Tagging, releases and semantic versioning
Reproducible environments: venv, conda, Poetry, pip-tools, renv
Containerisation with Docker and Singularity/Apptainer
Data and model versioning with DVC and Git LFS
Random seeds, provenance and build automation with make and snakemake
Continuous integration with GitHub Actions and GitLab CI/CD
Open-science practices: licences, DOIs, Zenodo and FAIR principles

Skills Developed

Git fluency Collaborative review Branching strategy Environment pinning Containerisation Build automation Reproducibility auditing Open-science publication

Suggested Resources

Chacon, S. & Straub, B. (2014). Pro Git, 2nd ed., Apress (free online, git-scm.com/book)
Peng, R.D. (2011). Reproducible Research in Computational Science, Science 334, 1226-1227
Wilson, G. et al. (2017). Good enough practices in scientific computing, PLOS Computational Biology
Nust, D. et al. (2020). Ten simple rules for writing Dockerfiles for reproducible data science, PLOS Computational Biology
The Turing Way Community (2022). The Turing Way: A handbook for reproducible data science (the-turing-way.netlify.app)
Official Git, GitHub Docs, Docker and GitHub Actions documentation
Software Carpentry: Version Control with Git lesson (software-carpentry.org)

Assessment

Assessment rewards the ability to turn a scratch analysis into a version-controlled, environment-pinned, reproducible project, with weight placed on sustained portfolio evidence and a terminal reproducibility audit.

Reproducible-project submission with Git history, lockfile and container (3000 words incl. README)50%
Reproducibility audit of an assigned peer project25%
Timed Git practical examination and MCQ paper25%
Practice bank: 200 MCQs · Timed mock & self-paced modes
Start Practice →