1
An Introduction to Git and GitHub
#OpenScienceKE
2
Outline
Git is a Version Control System.
GitHub is one of hosting services for Git Repositories
Git and GitHub
4
… And how it’s used
5
… And how it’s used
6
Code documentation
Open educational resources (OER)
… And how it’s used
7
Open Data
… And how it’s used
8
So many things...
… And how it’s used
9
Sign up! (Have you already done this ?)
10
First Repo
Cases:
Private Repositories
16
We are going to learn by doing
More resources:
Quick Intro to Markdown
20
Interface Tour & Jargon Busting
21
Make your own copy of the entire repository
22
Ways to get all the files from the web to your computer
23
Make your own copy of the entire repository
When you Fork a repository, you make your own copy that lives online on your GitHub account. When you Clone, you are copying the version controlled files to your computer. Changes you make won’t affect the original in either case.
Ways to get all the files from the web to your computer
24
Create, assign & manage Issues by clicking on this tab
25
Create, assign & manage Issues by clicking on this tab
26
Your default branch is the Master - but you can switch or add branches here
27
Your default branch is the Main - but you can switch or add branches here
If your collaborators suggest changes, as we will all do later, their changes go onto a new Branch until you accept them and Merge their changes into the Main.
28
The README is automatically rendered when you visit a repo
29
Upload files from your computer to this repo
30
Create a new file
31
Settings - add collaborators here
32
Settings - add collaborators here
Collaborators have permission to make changes to files in your repository without your approval (they are the inner circle). Anyone can be a Contributor via Pull Requests (though you don’t need to accept their contributions).
33
The README is automatically rendered when you visit a repo
Create, assign & manage Issues by clicking on this tab
Your default branch is the Master - but you can switch or add branches here
Create a new file
Upload files
Ways to get all the files from the web to your computer
Settings - add collaborators here
Make your own copy of the entire repository
34
Jargon Busting!
35
GitHub
:tada: = 🎉
36
Hands On Forking & README Editing!
🎉
37
Checkpoint
38
Part 2
39
In Depth GitHub Functionality
40
Issues Tracking
41
Issues
Issues are your “to-do’s” - they are the tasks you need to perform, the bugs you need to fix, and things you want to accomplish.
You can “label” issues and “assign” them to collaborators (or yourself) to do.
https://github.com/tiimgreen/github-cheat-sheet
42
Creating Issues:
43
Issue Tracking!
44
Branching and Merging
45
Creating a branch:
Notice when we create a branch - we can jump back and forth between our “READMEs” and see the different content. - <<quick demo! >>
46
Merging a branch into “master”:
You decide you like what you’ve done and want to merge those changes into your master branch. - <<mini demo >>
47
Creating a branch:
Notice when we create a branch - we can jump back and forth between our “READMEs” and see the different content. - <<quick demo! >>
48
Merging a branch into “master”:
You decide you like what you’ve done and want to merge those changes into your master branch. - <<mini demo >>
49
Forks & Pull Requests
50
Fork
VERB: To fork
you copy someone else’s repo with the intention to build on it/improve it and contribute back changes using “pull requests” - You are not a collaborator, but you may become a contributor.
You just did this!
NOUN: A fork
A copy of someone else’s project where you can make changes.
51
Pull Request
Make a pull request when you’ve made changes (commits) to a project.
Changes can be on a forked repo or a branch of your repo.
Merging these changes into the project either in the “master” branch or branch of interest. It is a “hey, pull these changes into the project”.
52
Hands on Exercise!
53
Checkpoint
55
Advanced GitHub
56
Git command line demo
Danielle Robinson Jessica Gallinger
Steph Wright Steve Van Tuyl
These slides have been edited for OpenScienceKE and East Africa Open Science Tour workshop by Caleb
57
Slides Attributions