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
0
210
GIT: Understanding Git architecture and object model
Explaining the architecture and object model of GIT
Pierre GOUDJO
December 30, 2021
Tweet
Share
More Decks by Pierre GOUDJO
See All by Pierre GOUDJO
Simplicity matters
pierregoudjo
0
57
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
47
Amazon Virtual Private Cloud
pierregoudjo
0
72
Service Discovery: Fundamentals
pierregoudjo
0
78
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
91
Property-based testing: The lazy programmer's guide to writing thousands of tests
pierregoudjo
0
92
Object storage: An exploration of AWS S3
pierregoudjo
0
47
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
81
Boring Technologies
pierregoudjo
0
47
Other Decks in Technology
See All in Technology
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
160
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
150
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
560
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
250
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
Storage Browser for Amazon S3
miu_crescent
1
140
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
380
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
We Have a Design System, Now What?
morganepeng
51
7.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
RailsConf 2023
tenderlove
29
940
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
For a Future-Friendly Web
brad_frost
175
9.4k
A better future with KSS
kneath
238
17k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
The World Runs on Bad Software
bkeepers
PRO
65
11k
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