Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Git, GitHub, Etc
Search
Andy Delcambre
April 19, 2014
Programming
3
210
Git, GitHub, Etc
How git and GitHub work, behind the scenes. Aka what I do in my day job.
Andy Delcambre
April 19, 2014
Tweet
Share
More Decks by Andy Delcambre
See All by Andy Delcambre
Git and GitHub at YAPC:Asia
adelcambre
1
3.3k
Systems Programming - SoCoded 2013
adelcambre
2
170
Ruby Systems Programming
adelcambre
4
1.1k
Debugging Production Service Oriented Systems
adelcambre
3
430
Ruby, Rails and Engine Yard - Úll
adelcambre
1
310
SFRuby Nov 2011 - Release Early and Release Often
adelcambre
2
81
Release early and Release often
adelcambre
2
480
Other Decks in Programming
See All in Programming
2024年のWebフロントエンドのふりかえりと2025年
sakito
1
230
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
110
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
5
3.8k
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
660
技術を根付かせる / How to make technology take root
kubode
1
240
Lottieアニメーションをカスタマイズしてみた
tahia910
0
120
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
300
DROBEの生成AI活用事例 with AWS
ippey
0
130
Amazon S3 TablesとAmazon S3 Metadataを触ってみた / 20250201-jawsug-tochigi-s3tables-s3metadata
kasacchiful
0
100
動作確認やテストで漏れがちな観点3選
starfish719
6
1k
AWS Lambda functions with C# 用の Dev Container Template を作ってみた件
mappie_kochi
0
240
時計仕掛けのCompose
mkeeda
1
280
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
67
4.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Music & Morning Musume
bryan
46
6.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
The Invisible Side of Design
smashingmag
299
50k
GraphQLとの向き合い方2022年版
quramy
44
13k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
How STYLIGHT went responsive
nonsquared
98
5.3k
Transcript
Git, GitHub, Etc Andy Delcambre
None
None
PLANET ARGON
None
None
None
None
DIRECTED ACYCLIC GRAPH
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 <file>..." 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 <
[email protected]
> Date: Mon Apr 14 15:41:34 2014 -0700 ! Add a README
8a720fa HEAD, master Refs Commit
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%
Commit 8a720fa ede0fc8 HEAD, master Refs Commit
yt $ git cat-file -p ede0fc8 tree 493fc85c806ebd9e49395561d2f9c98a5d9ebdce parent 8a720fa06710948f2ab79dd3e213ef745b6000c5
author Andy Delcambre <
[email protected]
> 1397516385 -0700 committer Andy Delcambre <
[email protected]
> 1397516385 -0700 ! Update README
Commit ede0fc8 8a720fa 493fc85 Parent Tree
yt $ git cat-file -p 493fc85 100644 blob 17ca828132ebdc5347f4c5c20484b9a33fffb294 README
!
Tree 493fc85 17ca828 Blob (README)
yt $ git cat-file -p 17ca828 My sweet repo It's
so awesome
GitHub
Secret:
Hosting a Git repo is Secret:
Hosting a Git repo is Secret: EASY
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.
None
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
None
None
GitHub Flow
Make a branch
Add Commits
Open a Pull Request
Discuss & Code Review
Merge and deploy
None
Not so Secret:
Hosting a *lot* of Git repos is Not so Secret:
Hosting a *lot* of Git repos is Not so Secret:
HARD
> 7 million repositories
1.5 million pushes
100 million pulls & clones
27 fileservers
100 TB of online storage
None
Grit
1st Commit GitHub
1st Commit GitHub 1st Commit Grit
Ruby wrapper around Git
repo = Grit::Repo.new(“grit.git”) ! repo.commits # => [#<Grit::Commit "e80bbd2ce67651aa18e57fb0b43618ad4baf7750">, #<Grit::Commit
"91169e1f5fa4de2eaea3f176461f5dc784796769">, #<Grit::Commit "038af8c329ef7c1bae4568b98bd5c58510465493">, #<Grit::Commit "40d3057d09a7a4d61059bca9dca5ae698de58cbe">, #<Grit::Commit "4ea50f4754937bf19461af58ce3b3d24c77311d9">]
This works for everything! ! (locally)
27 fileservers
Smoke “Grit in the cloud”
The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103
fe104 fe105 …
The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103
fe104 fe105 …
The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103
fe104 fe105 …
The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103
fe104 fe105 …
The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103
fe104 fe105 … BERTRPC
module Smoke def self.install! ::Grit.send(:remove_const, :Git) ! ::Grit.const_set(:Git, Smoke::Git) end
end
repo.ls_tree("HEAD").each do | entry| if entry.blob? repo.load_blob(entry.oid) end end
Death by Round Trip
A condensed (and probably wrong) history of git
Bitkeeper
Git
Shared library?
libgit2
JGit
libgit2 http://github.com/libgit2/libgit2
Rugged http://github.com/libgit2/rugged
Ruby wrapper around libgit2
repo = Rugged::Repository.new("rugged.git") ! repo.last_commit # => #<Rugged::Commit:2227356240 oid: 0277b7df0fea08d5f3fc7177e47527fc24d96a0e>
None
GitRPC The New Hotness aka
Like Smoke, But Better
Caching
Pluggable Wire Protocols
Encoding Aware
This is My Job
education.github.com
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/