Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GIT: Understanding Git architecture and object ...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Pierre GOUDJO
December 30, 2021
Technology
340
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GIT: Understanding Git architecture and object model
Explaining the architecture and object model of GIT
Pierre GOUDJO
December 30, 2021
Transcript
59 slides
Pierre Goudjo Git Understanding Git architecture and object model
None
None
Seriously, what is Git?
Git is a Version Control System
None
Git is a distributed Version Control System
A CENTRALIZED VCS
A DISTRIBUTED VCS
A Distributed VCS (in practice)
Each repository contains all the commits and history locally
None
Just like it sounds, a "remote" is a repo outside
your environment. Remotes
A Distributed VCS (in practice)
Cloning creates a remote called "origin" Remotes ~$ git clone
http://some.repo.com someDirectory ~$ git branch -a * master remotes/origin/master
Where is the remote? Remotes ~$ git remote -v origin
http://some.repo.com (fetch) origin http://some.repo.com (push)
A local branch may “track” a remote URL Remotes ~$
git branch -vv * master b956c45 [origin/master] Initial commit some-local-branch a74b295 Implemented that cool feature
Tracking Remotes
Tracking Remotes ~$ git checkout -b new-feature
Tracking Remotes ~$ git branch —set-upstream-to=origin/new-feature ~$ git checkout -b
new-feature
Tracking Remotes ~$ git branch —set-upstream-to=origin/new-feature ~$ git branch -u
origin/new-feature ~$ git checkout -b new-feature
Tracking Remotes ~$ git branch —set-upstream-to=origin/new-feature ~$ git branch -u
origin/new-feature ~$ git push -u origin/new-feature ~$ git checkout -b new-feature
Tracking Remotes ~$ git branch —set-upstream-to=origin/new-feature ~$ git branch -u
origin/new-feature ~$ git push -u origin/new-feature ~$ git checkout -b new-feature ~$ git checkout existing-branch-on-remote
Tracking Remotes ~$ git branch —set-upstream-to=origin/new-feature ~$ git branch -u
origin/new-feature ~$ git push -u origin/new-feature ~$ git branch -vv master b956c45 [origin/master] Initial commit new-feature b956c45 [origin/new-feature] Initial commit * existing-branch-on-remote b956c45 [origin/existing-branch-on-remote] Another commit some-local-branch a74b295 Implemented that cool feature ~$ git checkout -b new-feature ~$ git checkout existing-branch-on-remote
A Distributed VCS (in practice)
What about other repos? How this is distributed?
A DISTRIBUTED VCS
Other Remotes Remotes ~$ git remote add another http://another.repo.fr ~$
git remote -v origin http://some.repo.com (fetch) origin http://some.repo.com (push) another http://another.repo.fr (fetch) another http://another.repo.fr (push)
None
What about the version control part?
The major di ff erence between Git and other VCS
is the way they think about data
File states in Git
The staging area
CVS, SVN and others think of the information they store
as a set of data and the changes made to each fi le over time Δ-based version control
Every time you commit Git takes a picture of what
all your fi les look like at that moment Snapshot-based version control
Git store snapshots of directories and fi les Tree and
Blob Objects
Git commit structure
Commit objects parents
HEAD pointer
Branches
git branch testing Branch
git checkout testing Branch change in Git
Tagging
git reset —hard Discard commits
git reset —hard Discard commits
git branch <branch>; git checkout <branch>; git checkout -b <branch>
Commits and branches
git branch <branch>; git checkout <branch>; git checkout -b <branch>
Commits and branches
git merge <branch> ; git merge <branch> — ff -only
Fast-forward merge
git merge <branch> ; git merge <branch> — ff -only
Fast-forward merge
git merge <branch>; git merge <branch> —no- f Merge commits
git merge <branch>; git merge <branch> —no- f Merge commits
Multiple merge commits
git rebase <branch> Rebasing
git rebase <branch> Rebasing
Fast forwarding rebased branch
git cherry-pick <commit_hash> Cherry-picking
git cherry-pick <commit_hash> Cherry-picking
None
@pierregoudjo The End
More Decks by Pierre GOUDJO
See All by Pierre GOUDJO
Simplicity matters
pierregoudjo
0
92
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
71
Amazon Virtual Private Cloud
pierregoudjo
0
95
Service Discovery: Fundamentals
pierregoudjo
0
92
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
120
Property-based testing: The lazy programmer's guide to writing thousands of tests
pierregoudjo
0
140
Object storage: An exploration of AWS S3
pierregoudjo
0
88
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
100
Boring Technologies
pierregoudjo
0
68
Other Decks in Technology
See All in Technology
Re:ゼロから始めるシェアハウスのペットな鯖
silmin_
0
250
Linuxネットワークスタック進化の軌跡: 過去10年の歩みと最新トレンド
orimanabu
4
760
Gov-JAWS#9 統合監視機能のマネージドサービス化+AIによる障害時自動調査
fj_yoshimura_kosuke
0
210
gradle-best-practices 使ってみた
mikanichinose
0
160
WasmをRustにする技術
sansantech
PRO
1
120
IoTのデータ保存をSREの観点で考える
grimoh
1
110
あの日、見つかっていなかったらどうなっていたか
kazzpapa3
2
260
2026-11-11 Tamachi.sre#7 PaCにインフラリソースの命を救われました。 / PaC saves the infra resource life
masasuzu
1
210
速くなるほど、深く考える AI時代のQAに学ぶ
kobayashiyorimitsu
0
270
閉域網でのAPI公開の選択肢全部比較!
takano0131
4
570
さようならSSH鍵、こんにちはゼロトラスト ― AIフレンドリーで快適な自宅鯖SSH
atalie2m
14
7.2k
Biohub - Cell Tracking During Development 5th place solution
rist
0
180
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Technical Leadership for Architectural Decision Making
baasie
4
650
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.5k
Leo the Paperboy
mayatellez
11
2.5k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
900
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
350
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
750
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
A Tale of Four Properties
chriscoyier
163
24k