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
93
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
73
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
91
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
100
Boring Technologies
pierregoudjo
0
68
Other Decks in Technology
See All in Technology
AWS Client VPNの設定でハマったポイントとその過程での気づき
amarelo_n24
1
440
OCI Artifact による自動運転タクシーに向けた OTA 基盤の構築
biwashi
1
300
クラウドでも使えるNetApp -現場目線での設計とクラウドバックアップの活用
ryutakondo
1
330
2026-11-16 JAWS-UG コンテナ支部 #31 ゆるLT大会 ECR のライフサイクルポリシーを いい感じに設定したい / ECR Lifecycle policy
masasuzu
3
630
Kiro のリモートワークスペース: IDE は手元のままで、ワークスペースをクラウド、コンテナ、自前のマシンに置く
inariku
PRO
1
200
IP重複は"ランディングVPC"で受け止める ― PrivateLink と Transit Gatewayによるマルチテナント接続基盤の設計
hatahata021
3
270
常時稼働エージェントの作り方(Claude公式ブログを資料化)
minorun365
PRO
20
29k
gradle-best-practices 使ってみた
mikanichinose
0
230
リリースしたで終わらない。 観測できるフロントエンド開発
yamakenji24
4
420
Context parameters で作る!はじめての型クラス
kworkdev
PRO
1
180
ブース設計、 お前もプロダクトだったのか / So Booth Design Was a Product All Along
akihiro0038
0
150
社内アプリ基盤「Quartz」による、 非エンジニアとAIに本番デプロイを 任せても壊れないプラットフォームの設計
staka121
PRO
1
230
Featured
See All Featured
It's Worth the Effort
3n
188
30k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
690
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.8k
Un-Boring Meetings
codingconduct
0
510
Raft: Consensus for Rubyists
vanstee
143
7.9k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
550
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
790
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
570
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
820
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1.1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
610