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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Emily Hyland
February 28, 2013
Programming
3
200
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
54
Testing Ruby
duien
8
640
Other Decks in Programming
See All in Programming
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
210
Windows on Ryzen and I
seosoft
0
220
CSC307 Lecture 14
javiergs
PRO
0
450
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.8k
開発ステップを細分化する、破綻しないAI開発体制
kspace
0
110
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
740
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
220
株式会社 Sun terras カンパニーデック
sunterras
0
2k
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
250
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
210
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
190
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
290
Featured
See All Featured
Designing for Performance
lara
611
70k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
400
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
630
Information Architects: The Missing Link in Design Systems
soysaucechin
0
820
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
130
Chasing Engaging Ingredients in Design
codingconduct
0
130
Automating Front-end Workflow
addyosmani
1370
200k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
380
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The SEO Collaboration Effect
kristinabergwall1
0
380
KATA
mclloyd
PRO
35
15k
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