Slide 1

Slide 1 text

GIT AND GITHUB for better collaboration for better collaboration

Slide 2

Slide 2 text

&

Slide 3

Slide 3 text

[email protected] github.com/training @matthewmccull matthewmccullough

Slide 4

Slide 4 text

Who is Matthew? Open source contributor Build tool and continuous delivery author 5 year Git evangelist VP of Training at GitHub

Slide 5

Slide 5 text

What are we talking about? Why isn't it just SVN++? Rebasing demo Rename and merge demo How does Git facilitate collaboration? Pull Request demo How does Git + GitHub collate team contributions? SVN conversion tools

Slide 6

Slide 6 text

ITz Cray

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

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

No content

Slide 14

Slide 14 text

SVN++ ?

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

‣Local branches ‣Social coding ‣Fork and pull model ‣Web-based image diff ‣Lightweight issue tracking

Slide 18

Slide 18 text

Blessed Repo

Slide 19

Slide 19 text

refs

Slide 20

Slide 20 text

centralized VCSs use sequential revision numbers

Slide 21

Slide 21 text

Git uses a SHA-1 hash

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

40 hex characters (20 bytes)

Slide 24

Slide 24 text

9AB223D28B1AA46EF1780B22F304982E39872C34

Slide 25

Slide 25 text

9AB223D28B1AA46EF1780B22F304982E39872C34

This is a test

9AB223D28B1AA46EF1780B22F304982E39872C34

Slide 26

Slide 26 text

‣Blob ‣Tree ‣Commit ‣Tag

Slide 27

Slide 27 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 28

Slide 28 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 29

Slide 29 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 30

Slide 30 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 31

Slide 31 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 32

Slide 32 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 33

Slide 33 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 34

Slide 34 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 35

Slide 35 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 36

Slide 36 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 37

Slide 37 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 38

Slide 38 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 39

Slide 39 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 40

Slide 40 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 41

Slide 41 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 42

Slide 42 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 43

Slide 43 text

v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

Simpler merges

Slide 52

Slide 52 text

— No engineer, ever Wow! Version control!

Slide 53

Slide 53 text

DAG

Slide 54

Slide 54 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 Δ Δ Δ Δ Δ Δ Δ

Slide 55

Slide 55 text

Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Delta storage gets slower as the history of a file gets longer

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

Copy of the entire tree per commit

Slide 58

Slide 58 text

Why?

Slide 59

Slide 59 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 60

Slide 60 text

hard link to existing identical blobs

Slide 61

Slide 61 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 62

Slide 62 text

zlib deflates each blob at commit

Slide 63

Slide 63 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 64

Slide 64 text

zlib deflates the entire repo

Slide 65

Slide 65 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 66

Slide 66 text

Act I 2100 MB became 205 MB

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

Rebasing

Slide 69

Slide 69 text

a32 2e2 8b3 Master/Trunk/MainLatest e69 d19 Branch

Slide 70

Slide 70 text

a32 2e2 8b3 e69 d19 Branch Master/Trunk/MainLatest Rebase

Slide 71

Slide 71 text

a32 2e2 e69' d19' 8b3 Branch Master/Trunk/MainLatest Rebase

Slide 72

Slide 72 text

a32 2e2 e69' d19' 8b3 Branch Master/Trunk/MainLatest Merge

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

PRDD (Pull Request Driven Development)

Slide 75

Slide 75 text

Agile ‛ GIT

Slide 76

Slide 76 text

Idea ‛ Markdown

Slide 77

Slide 77 text

Review ‛ Pull Request

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

Visualizations

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

Subversion

Slide 84

Slide 84 text

SVN ‛ GIT

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

— Every manager, ever If it isn't broke, don't fix it.

Slide 90

Slide 90 text

Migration Tools

Slide 91

Slide 91 text

git-svn

Slide 92

Slide 92 text

git-svn Core Git feature

Slide 93

Slide 93 text

$ git svn clone -s http://yourhost.com/reporoot/

Slide 94

Slide 94 text

git-svn Consumes an authors email mapping file

Slide 95

Slide 95 text

(no author) = Codehaus infra sdevijver = Steven Devijver markcc = Mark CC joe = Joe ajtarter = Aaron J Tarter liddon = Lidia Donajczyk-Lipinska jshickey = Scott Hickey HamletDRC = Hamlet D'Arcy aalmiray = Andres Almiray blackdrag = Jochen Theodorou bob = Boc McWhirter brownj = Jeff Brown cstein = Christian Stein

Slide 96

Slide 96 text

git-svn Migrates Subversion tags to Git branches

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

svn2git

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

$ svn2git http://matthew.com/svnrepos/project1

Slide 101

Slide 101 text

importing to git

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

# Publish one branch $ svn2git http://matthew.com/svnrepos/project1 $ git remote add origin https://github.com/you/project1 $ git push origin master

Slide 104

Slide 104 text

# Publish all branches and tags $ svn2git http://matthew.com/svnrepos/svnproject1 $ git clone file://yourpath/svnproject1 gitproject1 $ cd gitproject1 $ git remote add origin https://github.com/you/project1 $ git push --mirror origin

Slide 105

Slide 105 text

Serving SVN from Git

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

$ svn co https://github.com/you/project1/trunk p1svn

Slide 108

Slide 108 text

Continuous delivery

Slide 109

Slide 109 text

pull requests

Slide 110

Slide 110 text

peer review

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

graph everything

Slide 116

Slide 116 text

No content

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

optimize for happiness

Slide 120

Slide 120 text

Thanks!

Slide 121

Slide 121 text

[email protected] github.com/training @matthewmccull matthewmccullough