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: Understanding Git architecture and object ...
Search
Pierre GOUDJO
December 30, 2021
Technology
330
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
More Decks by Pierre GOUDJO
See All by Pierre GOUDJO
Simplicity matters
pierregoudjo
0
83
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
65
Amazon Virtual Private Cloud
pierregoudjo
0
91
Service Discovery: Fundamentals
pierregoudjo
0
88
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
110
Property-based testing: The lazy programmer's guide to writing thousands of tests
pierregoudjo
0
130
Object storage: An exploration of AWS S3
pierregoudjo
0
81
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
100
Boring Technologies
pierregoudjo
0
66
Other Decks in Technology
See All in Technology
MCPを待つな、パスキーを拡げよう(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
310
型落ちシンクライアント端末のPoEモジュールを自作したかった話
logica0419
0
460
dbt と Snowflake と tag
kevinrobot34
1
250
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
[ホンマでっか SRE] あなたはなぜ SRE に?
_awache
0
270
AI時代の「OAuth認証」にどう物申すか?(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
300
IHV like なユースケースへのOpenID Connect 関連仕様の適用事例
optim
0
310
『自分で判断できるか』を基準に、プロダクトのハンズオン研修でAI利用の線を引いてみた / Where We Drew the Line on AI in Hands-on Training
honyanya
0
160
AIエージェントのためのデータ設計
daiz21
0
380
AWSとGitHub Actionsの責任境界と 組織で安全に使用する取り組み
nealle
0
170
dbt in Microsoft Fabric
ryomaru0825
0
260
Claude Codeの体系的な理解と知識のフック
oikon48
3
1.4k
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
550
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
240
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
480
The Curse of the Amulet
leimatthew05
2
14k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
ラッコキーワード サービス紹介資料
rakko
1
4.5M
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
Practical Orchestrator
shlominoach
191
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
sira's awesome portfolio website redesign presentation
elsirapls
0
340
Transcript
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