Git Overview
What is Git/GitHub and why do I want to use it?
Git is a version control system. It lets you track changes to your code and documents over time, so you can:
- Organise your work: keep your research projects, analysis scripts, and data files tidy and structured.
- Track changes: see what was added, removed, or modified, and go back to previous versions if something breaks.
- Collaborate safely: multiple people can work on the same project without overwriting each other’s work.
You can use Git entirely on its own for version control, however, most people want the extra functionality of connecting their local repository to the remote repository on GitHub.
GitHub is a cloud-based platform that works with Git. It lets you:
- Share your projects with others, or download packages and code that other researchers have shared.
- Collaborate on code and projects with colleagues or contributors around the world.
- Create webpages and reports using tools like Quarto (we’ll cover this in part two of the workshop).
- Host and publish your work online, making it easier to share and document your research reproducibly.
In short: Git keeps your work organised and versioned on your local computer, and GitHub lets you back it up, share it, and collaborate with others online.
Some cool examples of how people use git/github:
- The Kākāpō genome project, with all the scripts and workflows needed for the genome assembly.
- The website for the Genomics Aotearoa Bioinformatics Training Programme is hosted on GitHub, written in Quarto and displayed using GitHub Pages.
- A curated list of awesome ggplot2 packages
- The Linux kernel source tree is on GitHub (both Git and Linux were developed by Linus Torvalds)
- And if you really want to get into the weeds, the source code for both Git and GitHub are on GitHub!