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
46
Testing Ruby
duien
8
580
Other Decks in Programming
See All in Programming
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
Spatial Rendering for Apple Vision Pro
warrenm
0
110
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
510
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
140
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
940
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
160
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
190
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
2
110
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
850
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
Automating Front-end Workflow
addyosmani
1366
200k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Facilitating Awesome Meetings
lara
50
6.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Why Our Code Smells
bkeepers
PRO
335
57k
Site-Speed That Sticks
csswizardry
2
190
Side Projects
sachag
452
42k
It's Worth the Effort
3n
183
28k
A Tale of Four Properties
chriscoyier
157
23k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
BBQ
matthewcrist
85
9.4k
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