Reproducible Research › Module 3: Version control

GitHub for researchers

Lesson 3 of 3 · 2 min

Previous

Git keeps history on your computer. GitHub (and alternatives like GitLab and Codeberg) keeps a copy online, so you can back up, share and collaborate.

What you get

  • Backup: your laptop can die; your project won't.
  • Sharing: a public link reviewers and readers can open.
  • Collaboration: co-authors work on branches and propose changes with pull requests.
  • Issues: a to-do list and discussion board for the project.

A good research repository has

  1. A README: what it is, how to install, how to run, how to cite.
  2. A LICENSE file (Module 6).
  3. The environment file (Module 4).
  4. A CITATION.cff file, so GitHub shows a "Cite this repository" button.

Public or private?

Start private if you like, and make it public when you submit the paper. Many ML venues now expect code to be released, and papers with code are cited more and trusted more.

Automate checks

GitHub Actions can rerun your analysis on a fresh machine every time you push. If it breaks, you know immediately, not when a reviewer tries it.

Never push secrets

Passwords and API keys pushed to a public repo are found by bots within minutes. Keep them in environment variables or a git-ignored .env file.

RememberPush your project online for backup and sharing, with a README, licence and citation file. Never push secrets.