GitHub Intro for Beginners
1
Expanded content by by Malvika Sharan
References: Mozilla Science Lab's Study Group Orientation, �Friendly GitHub Intro by Kirstie Whitaker
Visual description: https://learngitbranching.js.org/
Previous trainers: Malvika Sharan, Yo Yehudi, Cassandra Gould van Praag, Esther Plomp, Emma Karoune, Sophia Batchelor, Batool Almarzouq
Arielle Bennett & Anne Lee Steele
https://github.com/alan-turing-institute/the-turing-way, @turingway, CC-BY 4.0. DOI 10.5281/zenodo.7788718
Overview
Reference: Library Carpentry: Introduction to Git
This will be a hands-on workshop!
Make sure you’re logged in to your Github account!
The Turing Way
A community-led guide to Data Science.
We involve and support a diverse community to make research reproducible, ethical, and collaborative for everyone.
@turingway, Image by Scriberia for The Turing Way , CC-BY 4.0, Zenodo: zenodo.org/record/7258956
Book
Global Collaboration
Community
Culture Change
Credit: This Slide was adapted from a talk co-delivered by Ann Lee Steele and Batool Almarzouq in Durham RIOTS Club: https://doi.org/10.5281/zenodo.7410496
Navigating Cultural Change through The Turing Way
Collaboration
6
To maximise the benefit of collaboration, we use version control!
The Turing Way project illustration by Scriberia. Used under a CC-BY 4.0 licence. DOI: 10.5281/zenodo.3332807
Credit: This slide and illustrations are taken from from the Openscapes blog GitHub for supporting, contributing, and failing safely by Allison Horst and Julia Lowndes
The Turing Way project illustration by Scriberia. Used under a CC-BY 4.0 licence. DOI: 10.5281/zenodo.3332807
Reference: Library Carpentry: Introduction to Git
Reference: Library Carpentry: Introduction to Git
Git is one of the most widely used version control systems in the world. It is a free, open source tool
GitHub on the other hand is a popular website for hosting and sharing Git repositories remotely. It offers a web interface!
Image from Mozilla Science Lab: https://mozillascience.github.io/study-group-orientation/3.1-collab-vers-github.html
A collection of files in a folder or directory, also known as a repository, or “repo.”
Image from Mozilla Science Lab: https://mozillascience.github.io/study-group-orientation/3.1-collab-vers-github.html
I created my repo to store my project details so that my supervisor can collaborate with me, and others can read it
Add information on changes
Credit: This slide and illustrations are taken from from the Openscapes blog GitHub for supporting, contributing, and failing safely by Allison Horst and Julia Lowndes
Image from Mozilla Science Lab: https://mozillascience.github.io/study-group-orientation/3.1-collab-vers-github.html
Revisions and Versions (in real-time)
You don’t save copies of your document, you just save the the life story of the document, or its timeline
Image from Mozilla Science Lab: https://mozillascience.github.io/study-group-orientation/3.1-collab-vers-github.html
We can do all of this on GitHub
Let’s get to know github.com
Step 1: Sign-up
Step 2: Log in
Complete with your username and password …
… then click
GitHub Exercise 1
Let’s dive in!
Exercise
Make your repo
“friendly-collab-party”
Repository (Repo)
A project where all your files are, online or on your computer
19
You know version control.
You created your first repo.
https://www.freeiconspng.com/img/31116
GitHub & Markdown
How to change format of the text?
Markdown (.md) for formatting
Create a README file
Markdown (.md) for formatting
Markdown: what’s that?
Markdown is a simple text “markup” language made for quickly writing formatted text
Great for blogs, documentation, and even writing papers.
GitHub automatically renders anything written in Markdown.
This can be specific files, pull requests, issues or comments.
Some useful resources:
GitHub Exercise 2
Let’s dive in!
Learning Objectives
Explain the different GitHub terms
Use these commands online in GitHub
GitHub Terms that we will mention
27
28
Commit
Credit: This slides and illustrations are taken from from the Openscapes blog GitHub for supporting, contributing, and failing safely by Allison Horst and Julia Lowndes
Credit: This slides and illustrations are taken from from the Openscapes blog GitHub for supporting, contributing, and failing safely by Allison Horst and Julia Lowndes
Credit: This slide and illustrations are taken from from the Openscapes blog GitHub for supporting, contributing, and failing safely by Allison Horst and Julia Lowndes
Branch & Fork
Branch & Fork
Fork
Task: Fork The Turing Way repo
user name
the-turing-way/the-turing-way
Pull Request (PR)
Fork + Pull Request
If you don’t own a repo and aren’t an official collaborator:
Pull Request (PR) - 1
Task: Edit by adding your details “workshops/github-workshop/2024-nov-intro.md”
Pull Request (PR) - 2
Task: Edit by adding your details “workshops/github-workshop/2024-nov-intro.md”
Merge
Merge
Review before merge: Demo
Users with write access can approve and merge PRs
Create an issue: Demo
Issues are like posts/messages
Issue vs Pull Request (PR)
Using Issue & PR Features
Using Issue & PR Features
Congratulations!
You now know:
Commit
Issue
Pull request
Merge
There are many more Github features that you can try in your own time.
Photo from @steve3p_0 on Unsplash
Contributing to The Turing Way on Github
The “README.md” is automatically rendered when you visit a repo
Create & manage “Issues”
Your default branch is “main” - but you can switch or add branches here
Download Zip to download the zipped repo onto your computer
Clone to your computer from the web using GitHub Desktop or git command
Fork this repo
Pull Request to add your changes into forked repo
Make “pull request” in your own repo
Branch & PR
Pull request in your own repo
Pull request
request to add your changes from a branch back into master
Merge
act of incorporating new changes (commits) from one branch to another
“merge” your pull request to your repo
Add collaborators to work as a core part of your team!
Add collaborators
Settings - add collaborators here
Click here
Add collaborator’s name here
Why and When would I add collaborators?
Add 1-2 of your project members or mentors as collaborators to your “friendly-collab-party”!
Git/GitHub Features
Fork
make a copy of someone else repository
Pull request
request to add your changes into a forked repository
Clone
copy a repository onto your local computer
Download Zip
download the content of a repository
Git/GitHub Feature
Project or Project Board
Sort issues, notes, to-dos in a set of columns. These could be:
Photo from @martzzl on Unsplash
Creating small website with GitHub
Sharing information on your own website
For an Open Research project:
The Answer is Yes!
☀️ Creating a small website
Working with GitHub Pages
Creating your site
See examples
70
Glossary & Questions
Don’t worry if you haven’t gotten all the terms yet - Play around more & clarify any questions by asking questions on Slack.
Happy Making!
Thanks!