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 model
Search
Pierre GOUDJO
December 30, 2021
Technology
0
170
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
39
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
39
Amazon Virtual Private Cloud
pierregoudjo
0
65
Service Discovery: Fundamentals
pierregoudjo
0
72
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
74
Property-based testing: The lazy programmer's guide to writing thousands of tests
pierregoudjo
0
88
Object storage: An exploration of AWS S3
pierregoudjo
0
40
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
72
Boring Technologies
pierregoudjo
0
42
Other Decks in Technology
See All in Technology
コードや知識を組み込む / Incorporate Code and knowledge
ks91
PRO
0
150
【SORACOM UG 東海】あらゆるモノがつながる社会へ、IoT と SORACOM
soracom
PRO
1
150
web-application-security
matsuihidetoshi
1
190
Cypress or Playwright?
rainerhahnekamp
0
170
IaCジェネレーターとBedrockで詳細設計書を生成してみた
tsukasa_ishimaru
4
890
IaCからAWSに入門した初心者が CloudFormationを通して考えた「AWS操作」の使い分け
maimyyym
1
250
MapLibreとAmazon Location Service
dayjournal
1
190
Tellus の衛星データを見てみよう #mf_fukuoka
kongmingstrap
0
280
いいたいことちゃんという
tkengo
0
240
Building a RAG-poweredAI chat appwith Python and VS Code
pamelafox
0
160
生成AIの変革の時代に、直近1年で直面した課題とその解決策
ktc_wada
0
700
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
260
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
22
1.6k
Unsuck your backbone
ammeep
663
57k
Imperfection Machines: The Place of Print at Facebook
scottboms
261
12k
Infographics Made Easy
chrislema
238
18k
Faster Mobile Websites
deanohume
300
30k
A designer walks into a library…
pauljervisheath
201
23k
Ruby is Unlike a Banana
tanoku
96
10k
Designing for Performance
lara
601
67k
Making Projects Easy
brettharned
109
5.5k
A Tale of Four Properties
chriscoyier
152
22k
Docker and Python
trallard
35
2.7k
Automating Front-end Workflow
addyosmani
1357
200k
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