Slide 1

Slide 1 text

A foundation of collaboration presented to the delegates of SIGCSE 2014 Version control with

Slide 2

Slide 2 text

Matthew.... @matthewmccull ‣Open source contributor ‣O'Reilly Git Video Co-instructor ‣Co-Author of O'Reilly's Git book ‣5-year Git trainer ‣Instructor at GitHub

Slide 3

Slide 3 text

http://oreil.ly/ogitvid

Slide 4

Slide 4 text

http://amzn.to/oreillygit

Slide 5

Slide 5 text

Version Control A refreshed approach to VCS

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Open Source

Slide 8

Slide 8 text

bash scripts ☛ C code

Slide 9

Slide 9 text

is not a slightly better

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

http://git-scm.com

Slide 14

Slide 14 text

Starting Up Creating a repository

Slide 15

Slide 15 text

Get a GitHub account.

Slide 16

Slide 16 text

Get a GitHub account. http://github.com/join

Slide 17

Slide 17 text

Create a new repo(sitory).

Slide 18

Slide 18 text

Add a file.

Slide 19

Slide 19 text

View the commit history (timeline).

Slide 20

Slide 20 text

Make changes to the file.

Slide 21

Slide 21 text

Repo Creation Local and remote initialization simplicity

Slide 22

Slide 22 text

# Green field project! $ git init newproject! $ cd newproject! # ...start coding

Slide 23

Slide 23 text

or if you already have source code

Slide 24

Slide 24 text

# Legacy project tree! $ cd existingproject! $ git init! ! # Add all the code! $ git add .! $ git commit -m”Initial import”


Slide 25

Slide 25 text

‣ Blob ‣ Tree ‣ Commit ‣ Tag

Slide 26

Slide 26 text

tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162

Slide 27

Slide 27 text

Collaborating Two authors

Slide 28

Slide 28 text

Make simultaneous changes to the file.

Slide 29

Slide 29 text

Collaborating Redux Untrusted collaborators

Slide 30

Slide 30 text

Untrusted changes to the file.

Slide 31

Slide 31 text

Changelist Three stage thinking

Slide 32

Slide 32 text

Working Staging Repo add commit edit

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

‣shopping cart ‣ put things in ‣ take things out ‣ purchase at register

Slide 35

Slide 35 text

v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File B File B File A File A File C File C File C

Slide 36

Slide 36 text

Workspaces The power of simple branch toggling

Slide 37

Slide 37 text

Local Remote Upstream

Slide 38

Slide 38 text

# Creating a branch! git branch

Slide 39

Slide 39 text

RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1

Slide 40

Slide 40 text

What do cheap branches enable?

Slide 41

Slide 41 text

‣ Experimentation ‣


Slide 42

Slide 42 text

‣ Experimentation ‣ Safe experimentation

Slide 43

Slide 43 text

Better reuse of units of work

Slide 44

Slide 44 text

Work Models Enabling different development styles

Slide 45

Slide 45 text

product v1.0 integration story1 story2 v1.5 integration story3

Slide 46

Slide 46 text

Local Remote Upstream Integ Product Integ Product Integ Product

Slide 47

Slide 47 text

Local Remote Upstream Idea Story Feature Feature Feature Integ Product Integ Product Integ Product

Slide 48

Slide 48 text

Local Remote Upstream Idea Story Feature Feature Feature Integ Product Integ Product Integ Product

Slide 49

Slide 49 text

Central Repo C e n t r a l i z e d

Slide 50

Slide 50 text

Blessed Repo D i c t a t o r s h i p

Slide 51

Slide 51 text

Certified Repo Development Repo t e g r a t i o n M a n a g e d Continuous
 Integration
 Server

Slide 52

Slide 52 text

C u s t o m + P u b l i c C o n t r i b Customized ☚ Private Public ☛ GitHub

Slide 53

Slide 53 text

Mirror Development Repo M i r r o r e d Mirror Certified Repo

Slide 54

Slide 54 text

Client Apps GUIs and other front-ends

Slide 55

Slide 55 text

http://windows.github.com

Slide 56

Slide 56 text

http://windows.github.com

Slide 57

Slide 57 text

http://mac.github.com

Slide 58

Slide 58 text

http://mac.github.com

Slide 59

Slide 59 text

Remotes Bandwidth and geographic challenges

Slide 60

Slide 60 text

Local Remote Upstream

Slide 61

Slide 61 text

Local Remote Upstream

Slide 62

Slide 62 text

Local Remote Upstream

Slide 63

Slide 63 text

data from http://whygitisbetterthanx.com/#git-is-fast Init git svn Status git svn Diff git svn Tag git svn Log git svn Commit (Lg) git svn Commit (Sm) git svn Branch git c svn c Speed

Slide 64

Slide 64 text

Local Remote Upstream commit fetch push clone clone clone push pull pull pull

Slide 65

Slide 65 text

Commit Push Pull

Slide 66

Slide 66 text

Commit Push Pull

Slide 67

Slide 67 text

Commit Push Pull

Slide 68

Slide 68 text

Integration CI, scripting, and hooks

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

"This is so important, we can't entrust it to automation. We need our top developer to supervise it."

Slide 71

Slide 71 text

continuous integration servers jenkins travis ci circleci buildhive

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

Summary The Git and GitHub ecosystem

Slide 78

Slide 78 text

[email protected] education.github.com @matthewmccull Q&A

Slide 79

Slide 79 text

• http://education.github.com • [email protected]
 • http://git-scm.com/book • http://training.github.com Resources