Git + GitHub

An Introduction

Ethos

Openness

Friendliness

Helpfulness

Why Git

Profressional

Powerful / State of the art

Flexible - it has gears

  • Can be used at different levels of complexity

Version Control

GitHub (Open Science + Sharing)

What is

Git

Backup v Version Control

Backup

Date Files
3.33pm 3 March 2018 Introduction_draft.md
12.18pm 29 Feb 2018 Introduction_v2.md
8.49am 29 Feb 2018 Introduction_final_v2.md
12.30pm 21 Feb 2018 Introduction_final.md

Backup

Version Control

Title Files Comment
Polishing Second Draft Introduction.md Oh yea!!
Second Draft Introduction.md quite happy with this
Experimental Paragraph Introduction.md Not right, but not wrong
Feedback Implemented Introduction.md I don't understand what she wants ...

Version Control

  • All the power of BackUp - but you're in control
  • Meaningful History
  • Identifiable Stages of Work

Distributed

Distributed

  • Version Control extends to multiple copies on multiple computers
  • Thus --> GitHub
  • Leads to:
    • ​Sharing files, code, data
    • Collaboration
    • Open Science

Workshop Structure

Repetition + Concepts

  • Explanation
  • Demo of workflow from me
  • You go through workflow (with help)
  • Go Through Workflow with command line

How Git

Works

Pt. One

Four Sci-Fi Powers

Let you have control over your files

πŸ“– Captain's Log / Dear Diary

  • Keep a log or diary
  • of all your work
  • and your thoughts about it

πŸ•° Time Travel

  • Freely move through the history of your work
    • undo bad work
    • retrieve lost work
    • review changes a collaborator had made

πŸŒœπŸŒ› Parallel Universes

  • Move between multiple parallel histories of your work
  • Allows for:
    • Experimental work (without breaking things)
    • Collaboration (without breaking things)

πŸ›° Space Station / Citadel of Git

  • Store and share your history online
  • GitHub (and many alternatives)
  • Allows for:
    • Sharing
    • Collaboration
    • Open Science

πŸ“– Dear Diary / Captain's Log

πŸ•° Time Travel

πŸŒœπŸŒ› Parallel Universes

πŸ›° Space Station

  • Detailed History of Your Work
  • You're in control
  • Use and Review your History however you like
  • Nothing is Lost
  • Multiple Versions of your Project
  • Manage experiments and collaboration
  • Host, Store and Share Your History online
  • Share and Publish

How Git

Works

Pt. Two

Captain's Log

or

Dear Diary

How Changes to Files are Recorded

A file that's been changed

Version_1.txt

Version_2.txt

Backup:

  1. Version_1.txt
  2. Version_2.txt

A file that's been changed

Version_1.txt

Version_2.txt

Backup:

  1. Version_1.txt
  2. Version_2.txt

Git:

My_File.txt

The Power of Tracking Changes

Power of Tracking Changes

?

Power of Tracking Changes

Version Control

Version Control

You Decide

A

B

C

D

Getting Started

First Paragraph

Introduction Finished

Outline of the discussion

Version Control

You Decide

A, B, C

D

Getting Started

First Paragraph

Introduction Finished

Outline of the discussion

Version Control

You Decide

B, C, D

A

Getting Started

First Paragraph

Introduction Finished

Outline of the discussion

Challenge

Time Travel

Can look at any previous version of your file. Β Without having multiple files.

Time Travel

A

B

C

B-Rev

A-Rev

C-Reverse

Time Travel - Change History

A

B

C

B-Rev

D

B-Rev

Reversion

Challenge

Parallel Universes

Parallel Universes

A

B

C

X

Y

X, Y

Branch

"experiment"

Merge

X:

Y:

Branch

"Master"

Parallel Universes

A

B

C

X

Y

X, Y

"experiment"

"Master"

"Master" -

"experiment" -

A + B + C + X + Y

A + X + Y

Challenge

Space Station

Sharing and Collaborating on GitHub

A

B

C

X, Y

Git Repository on Your Computer

Git Repository on GitHub / GitLab / BitBucket

Sharing & Collaborating

A

B

C

X, Y

A

B

C

X

Y

X, Y

Your GitHub Account

Someone Else's GitHub Account

Sharing & Collaborating

A

B

C

X

Y

X, Y

Branch

Your GitHub Account

Someone Else's GitHub Account

Permissions

They Must Request to merge

You don't have access

You DO have access

You must accept the request

Your GitHub Account

Someone Else's GitHub Account

Challenge

Git+GitHub Intro

By Errol Lloyd

Git+GitHub Intro

  • 274