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: an introduction
Search
Emily Hyland
February 28, 2013
Programming
3
170
Git: an introduction
Emily Hyland
February 28, 2013
Tweet
Share
More Decks by Emily Hyland
See All by Emily Hyland
Programming for Humans
duien
0
51
Testing Ruby
duien
8
610
Other Decks in Programming
See All in Programming
Terraform やるなら公式スタイルガイドを読もう 〜重要項目 10選〜
hiyanger
13
3.1k
CLI ツールを Go ライブラリ として再実装する理由 / Why reimplement a CLI tool as a Go library
ktr_0731
3
1.1k
LLMOpsのパフォーマンスを支える技術と現場で実践した改善
po3rin
8
920
CEDEC 2025 『ゲームにおけるリアルタイム通信への QUIC導入事例の紹介』
segadevtech
3
870
STUNMESH-go: Wireguard NAT穿隧工具的源起與介紹
tjjh89017
0
370
Langfuseと歩む生成AI活用推進
licux
3
160
それ CLI フレームワークがなくてもできるよ / Building CLI Tools Without Frameworks
orgachem
PRO
17
3.9k
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
270
可変性を制する設計: 構造と振る舞いから考える概念モデリングとその実装
a_suenami
10
1.7k
React 使いじゃなくても知っておきたい教養としての React
oukayuka
18
5.7k
Understanding Ruby Grammar Through Conflicts
yui_knk
1
110
DataformでPythonする / dataform-de-python
snhryt
0
170
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
It's Worth the Effort
3n
186
28k
Faster Mobile Websites
deanohume
309
31k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Making Projects Easy
brettharned
117
6.3k
How STYLIGHT went responsive
nonsquared
100
5.7k
Adopting Sorbet at Scale
ufuk
77
9.5k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
770
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Transcript
Git an introduction
Rails Girls ATL
[email protected]
Emily Price ✉ Text Text
What is git?
Git is a distributed version control system
a version control system OK, so what is
a version control system
version snapshot of managed files a version control system
version snapshot of managed files control save and retrieve versions
a version control system
version snapshot of managed files control save and retrieve versions
system set of integrated tools a version control system
version snapshot of managed files control save and retrieve versions
system set of integrated tools a version control system
Git is a version control system
Git is a set of integrated tools to save and
retrieve snapshots of managed files
What does it mean that git is distributed?
Let’s talk history
In the beginning... there was local version control
And then for teams... there was central version control
Which evolved into... distributed version control
What does it mean that git is distributed?
What does it mean that git is distributed?
What does it mean that git is distributed? No central
server necessary
What does it mean that git is distributed? No central
server necessary Every copy contains full history
What does it mean that git is distributed? No central
server necessary Every copy contains full history Most operations don’t require network
Why use version control?
Why use version control?
Why use version control? Allow rewinding changes
Why use version control? Allow rewinding changes Easier to collaborate
Why use version control? Allow rewinding changes Easier to collaborate
See when something changed
Terminology
Git has a lot of terminology
repository working directory commit index the full set of files
and history lives in .git directory the visible files of your project everything outside of .git a snapshot of your project staging area for next commit
remote repository local repository working directory index pull fetch push
commit add checkout clone
remote repository local repository working directory index pull fetch push
commit add checkout clone
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository working directory index fetch push commit add checkout
clone local repository pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
remote repository local repository working directory index fetch push commit
add checkout clone pull
The anatomy of a commit
Every commit is identified by a SHA1 hash
A hash function maps data of variable length to data
of fixed length, predictably
Digest::SHA1.hexdigest('foo') 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 SHA1
Git hashes the contents and attributes of a commit
Actions contents attributes files and directories changed, added or deleted
SHA of parent commit message
c14f2de blob a20b616 blob bc4d0fb blob commit tree parent author
committer message 000742a 38a0164 1f62407 duien duien ... tree tree blob 38a0164 7095bff bc4d0fb tree blob blob 7095bff c14f2de a20b616
Branching and merging
time
time master HEAD
time master HEAD
time master HEAD
time master HEAD
time comments HEAD master
time comments HEAD master
time comments master HEAD
time master HEAD comments
time master comments HEAD
time master comments HEAD
time master comments HEAD
time comments master HEAD
time master comments HEAD
time master comments HEAD
time master comments HEAD
time master comments HEAD
time master comments HEAD
time master comments HEAD
time master comments HEAD
Putting it into practice
GitHub has good install guides at help.github.com
Make a git repo for your Rails Girls projects
DEMO
git-scm.com try.github.com help.github.com ndpsoftware.com/git-cheatsheet.html More Resources