Slide 1

Slide 1 text

Git, GitHub, Etc Andy Delcambre

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

PLANET ARGON

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

DIRECTED ACYCLIC GRAPH

Slide 10

Slide 10 text

yt $ git init Initialized empty Git repository in /private/tmp/demo/.git/ yt $ echo "My sweet repo" > README yt ✗ $ git add README yt ✗ $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached ..." to unstage) # # new file: README # yt ✗ $ git commit -m "Add a README" [master (root-commit) 8a720fa] Add a README 1 file changed, 1 insertion(+) create mode 100644 README yt $ git log commit 8a720fa06710948f2ab79dd3e213ef745b6000c5 Author: Andy Delcambre Date: Mon Apr 14 15:41:34 2014 -0700 ! Add a README

Slide 11

Slide 11 text

8a720fa HEAD, master Refs Commit

Slide 12

Slide 12 text

yt $ echo "It's so awesome" >> README yt ✗ $ git add README yt ✗ $ git commit -m "Update README" [master ede0fc8] Update README 1 file changed, 1 insertion(+) yt $ git log --graph --decorate --pretty=oneline * ede0fc8 (HEAD, master) Update README * 8a720fa Add a README%

Slide 13

Slide 13 text

Commit 8a720fa ede0fc8 HEAD, master Refs Commit

Slide 14

Slide 14 text

yt $ git cat-file -p ede0fc8 tree 493fc85c806ebd9e49395561d2f9c98a5d9ebdce parent 8a720fa06710948f2ab79dd3e213ef745b6000c5 author Andy Delcambre 1397516385 -0700 committer Andy Delcambre 1397516385 -0700 ! Update README

Slide 15

Slide 15 text

Commit ede0fc8 8a720fa 493fc85 Parent Tree

Slide 16

Slide 16 text

yt $ git cat-file -p 493fc85 100644 blob 17ca828132ebdc5347f4c5c20484b9a33fffb294 README !

Slide 17

Slide 17 text

Tree 493fc85 17ca828 Blob (README)

Slide 18

Slide 18 text

yt $ git cat-file -p 17ca828 My sweet repo It's so awesome

Slide 19

Slide 19 text

GitHub

Slide 20

Slide 20 text

Secret:

Slide 21

Slide 21 text

Hosting a Git repo is Secret:

Slide 22

Slide 22 text

Hosting a Git repo is Secret: EASY

Slide 23

Slide 23 text

enzo $ git init --bare demo.git Initialized empty Git repo in /home/adelcambre/git/demo.git/ ! yt $ git remote add origin adelcambre@enzo:git/demo.git yt $ git push origin master Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 473 bytes, done. Total 6 (delta 0), reused 6 (delta 0) To adelcambre@enzo:git/demo.git * [new branch] master -> master ! yt $ git clone adelcambre@enzo:git/demo.git Cloning into 'demo'... remote: Counting objects: 6, done. remote: Compressing objects: 100% (2/2), done. remote: Total 6 (delta 0), reused 0 (delta 0) Receiving objects: 100% (6/6), done.

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

yt $ git remote add -f origin [email protected]:adelcambre/demo.git Updating origin From github.com:adelcambre/demo * [new branch] master -> origin/master ! yt $ git push origin master Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 473 bytes, done. Total 6 (delta 0), reused 6 (delta 0) To https://github.com/adelcambre/demo.git * [new branch] master -> master

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

GitHub Flow

Slide 29

Slide 29 text

Make a branch

Slide 30

Slide 30 text

Add Commits

Slide 31

Slide 31 text

Open a Pull Request

Slide 32

Slide 32 text

Discuss & Code Review

Slide 33

Slide 33 text

Merge and deploy

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Not so Secret:

Slide 36

Slide 36 text

Hosting a *lot* of Git repos is Not so Secret:

Slide 37

Slide 37 text

Hosting a *lot* of Git repos is Not so Secret: HARD

Slide 38

Slide 38 text

> 7 million repositories

Slide 39

Slide 39 text

1.5 million pushes

Slide 40

Slide 40 text

100 million pulls & clones

Slide 41

Slide 41 text

27 fileservers

Slide 42

Slide 42 text

100 TB of online storage

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

Grit

Slide 45

Slide 45 text

1st Commit GitHub

Slide 46

Slide 46 text

1st Commit GitHub 1st Commit Grit

Slide 47

Slide 47 text

Ruby wrapper around Git

Slide 48

Slide 48 text

repo = Grit::Repo.new(“grit.git”) ! repo.commits # => [#, #, #, #, #]

Slide 49

Slide 49 text

This works for everything! ! (locally)

Slide 50

Slide 50 text

27 fileservers

Slide 51

Slide 51 text

Smoke “Grit in the cloud”

Slide 52

Slide 52 text

The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103 fe104 fe105 …

Slide 53

Slide 53 text

The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103 fe104 fe105 …

Slide 54

Slide 54 text

The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103 fe104 fe105 …

Slide 55

Slide 55 text

The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103 fe104 fe105 …

Slide 56

Slide 56 text

The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103 fe104 fe105 … BERTRPC

Slide 57

Slide 57 text

module Smoke def self.install! ::Grit.send(:remove_const, :Git) ! ::Grit.const_set(:Git, Smoke::Git) end end

Slide 58

Slide 58 text

repo.ls_tree("HEAD").each do | entry| if entry.blob? repo.load_blob(entry.oid) end end

Slide 59

Slide 59 text

Death by Round Trip

Slide 60

Slide 60 text

A condensed (and probably wrong) history of git

Slide 61

Slide 61 text

Bitkeeper

Slide 62

Slide 62 text

Git

Slide 63

Slide 63 text

Shared library?

Slide 64

Slide 64 text

libgit2

Slide 65

Slide 65 text

JGit

Slide 66

Slide 66 text

libgit2 http://github.com/libgit2/libgit2

Slide 67

Slide 67 text

Rugged http://github.com/libgit2/rugged

Slide 68

Slide 68 text

Ruby wrapper around libgit2

Slide 69

Slide 69 text

repo = Rugged::Repository.new("rugged.git") ! repo.last_commit # => #

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

GitRPC The New Hotness aka

Slide 72

Slide 72 text

Like Smoke, But Better

Slide 73

Slide 73 text

Caching

Slide 74

Slide 74 text

Pluggable Wire Protocols

Slide 75

Slide 75 text

Encoding Aware

Slide 76

Slide 76 text

This is My Job

Slide 77

Slide 77 text

education.github.com

Slide 78

Slide 78 text

Questions! Git for Computer Scientists http://eagain.net/articles/git-for-computer-scientists/ My mom told me git doesn’t scale https://vimeo.com/64716825 GitHub Flow https://guides.github.com/introduction/flow/index.html How GitHub uses GitHub to build Github http://zachholman.com/talk/how-github-uses-github-to-build-github/