Do you really understand Git?

E
ESUGESUG
Do you really understand
Git?
本当に分かる?
by Guille Polito, Pablo Tesone
@GuillePolito, @Tesonep
Evref
fervE
Why ?
• Visibility
• Manage more than only code
• Lower entry barrier into the community
• Lots of exis
ti
ng tools
• Good branch support, good di
ff
• …
Where would you place
yourself?
Where would you place
yourself?
Where would you place
yourself?
Where would you place
yourself?
A Test
$
How do you **clean** your working copy?
A Test
$ git reset
How do you **clean** your working copy?
This will reset your index
A Test
$ git reset --hard
How do you **clean** your working copy?
Well, yes, but not quite.
This will reset your working copy.
But not remove untracked
fi
les.
A Test
How do you **clean** your working copy?
$ git reset --hard
$ git clean -fd
is not easy
• New terminology:
index, HEAD, pull, push, fetch
• False friends: merge, commit
• Command-line oriented
• Documenta
ti
on is some
ti
mes ambiguous, some
ti
mes
incomplete
is not easy (2)
• Mul
ti
ple work
fl
ows are a two-edged machete
There is no One, single ring to rule them all
• People mix work
fl
ows, philosophy and technical
solu
ti
ons (try reading some blogs…)
• Graphical tools are too general or too speci
fi
c
An easy way to
1. It’s a graph!
2. It’s a two-stage database!
as a Graph
b8bfed7
7ba52e5
35ac17f
a4153b1
b01aba4 feature_branch
master_branch
v1.0 <tag>
HEAD
parent
reference
Labels:
ti
me
moves
in
this
direc
ti
on
commit
37adf4e master HEAD
parent
reference
Labels:
ti
me
moves
in
this
direc
ti
on
commit
37adf4e
master HEAD
0c0e5ff
parent
reference
Labels:
ti
me
moves
in
this
direc
ti
on
branch
parent
reference
Labels:
37adf4e
master
0c0e5ff
development
HEAD
ti
me
moves
in
this
direc
ti
on
commit (2)
parent
reference
Labels:
37adf4e
master
0c0e5ff
development
dc4a3e7 HEAD
ti
me
moves
in
this
direc
ti
on
checkout
37adf4e
master
0c0e5ff
development
b894b84 dc4a3e7
HEAD
parent
reference
Labels:
ti
me
moves
in
this
direc
ti
on
checkout
37adf4e
master
0c0e5ff
development
b894b84 dc4a3e7
HEAD
parent
reference
Labels:
ti
me
moves
in
this
direc
ti
on
DETACHED
HEAD?
parent
reference
Labels:
37adf4e
master
HEAD
0c0e5ff
v1.0.0
ti
me
moves
in
this
direc
ti
on
merge
parent
reference
Labels:
37adf4e
master
0c0e5ff
development
b894b84 dc4a3e7
HEAD
ti
me
moves
in
this
direc
ti
on
merge
parent
reference
Labels:
37adf4e
master
0c0e5ff
development
b894b84 dc4a3e7
2dae910 HEAD
ti
me
moves
in
this
direc
ti
on
merge
fast-forward
parent
reference
Labels:
37adf4e
0c0e5ff
development dc4a3e7
master HEAD
ti
me
moves
in
this
direc
ti
on
merge
fast-forward
parent
reference
Labels:
37adf4e
0c0e5ff
development dc4a3e7 master HEAD
ti
me
moves
in
this
direc
ti
on
as a 2-stage
Database
Working Copy Index Repository
What you see Where
commits are
A “hidden”
staging area
(sort of)
Remote
repositories
add
Working Copy Index Repository
commit
Working Copy Index Repository
checkout
Working Copy Index Repository
fetch
Working Copy Index Repository
push
Working Copy Index Repository
pull?
$ git fetch
$ git merge
Iceberg
+ =
h
tt
ps://github.com/pharo-vcs/iceberg
+
Just makes it harder
• Image-based persistence
• Files vs packages
• Mon
ti
cello adds
more false friends!
The 4
ti
ps of the Iceberg
Show the “Good” Path
Warn about Destruc
ti
on
Guide out of the Darkness
Use a Clear Language
workingCopy commitWithMessage: ‘message’.
aRepository head.
aBranch pull.
Iceberg’s Working Copy
• A repository has an
in-image working copy
• A working copy remembers its
current commit
• Required for pulling, pushing,
di
ffi
ng...
Pharo Image
Iceberg
Working Copy
commit=dc4a3e7
Dual Working Copy
Working Copy Repository
…
To be able to work, the working copy
should be in-sync with the working
copy in disk
Pharo Image
Iceberg
Working Copy
commit=dc4a3e7
commit=dc4a3e7
Detached Working Copy
Working Copy Repository
…
The working copy in the image can get
desync from the working copy in disk
Pharo Image
Iceberg
Working Copy
commit=dc4a3e7
commit=0c0c5ff
Why do I get
Detached Working Copy?
Although quite rare:
• Possibility 1) You touched your git repository from
outside the image
• Possibility 2) Your image crashed in between commits
• Possibility 3) You forgot to save your image a
ft
er a
commit
How do I get out of
Detached Working Copy?
• Op
ti
on 1) Move your image to your repository state
(load what is in the disk)
• Op
ti
on 2) Move your repository state to what is in the
image (checkout image’s commit)
• Op
ti
on 3) Try merging both
Takeovers
• Git is the assembly of version control
• But you need to know the internals
• commit graph and references
• working copy, staging area
• Iceberg deals with image-based persistency
1 de 45

Recomendados

An introduction to Git.An introduction to Git.
An introduction to Git.Sten Govaerts
755 visualizações29 slides
Do you really understand git?Do you really understand git?
Do you really understand git?ESUG
2.3K visualizações42 slides
Git censored.keyGit censored.key
Git censored.keymkramer2
922 visualizações85 slides
Git - Some tips to do it betterGit - Some tips to do it better
Git - Some tips to do it betterJonas De Smet
2.8K visualizações27 slides
Dive into .gitDive into .git
Dive into .gitnishio
1.1K visualizações19 slides

Mais conteúdo relacionado

Similar a Do you really understand Git?

Github basicsGithub basics
Github basicsRadoslav Georgiev
16.9K visualizações28 slides
Gitting the Most From GitGitting the Most From Git
Gitting the Most From GitChris Miller
959 visualizações84 slides
Clean Manifests with Puppet::TidyClean Manifests with Puppet::Tidy
Clean Manifests with Puppet::TidyPuppet
4.5K visualizações51 slides
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
3.5K visualizações67 slides

Similar a Do you really understand Git?(20)

Github basicsGithub basics
Github basics
Radoslav Georgiev16.9K visualizações
Gitting the Most From GitGitting the Most From Git
Gitting the Most From Git
Chris Miller959 visualizações
Clean Manifests with Puppet::TidyClean Manifests with Puppet::Tidy
Clean Manifests with Puppet::Tidy
Puppet4.5K visualizações
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith3.5K visualizações
Git RealGit Real
Git Real
Gong Haibing696 visualizações
Source andassetcontrolingamedevSource andassetcontrolingamedev
Source andassetcontrolingamedev
Matt Benic196 visualizações
Source control managementSource control management
Source control management
Owen Winkler1.2K visualizações
Git Things DoneGit Things Done
Git Things Done
FITC1.8K visualizações
Enterprise gitEnterprise git
Enterprise git
Pedro Melo547 visualizações
Community and Github: 7/27/2011Community and Github: 7/27/2011
Community and Github: 7/27/2011
Andy Lester1.6K visualizações
First appFirst app
First app
Benjamin Taylor322 visualizações
Gitlikeapro 2019Gitlikeapro 2019
Gitlikeapro 2019
Jesús Miguel Benito Calzada44 visualizações
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya1.5K visualizações
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professional
zwheller1.1K visualizações
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn2.3K visualizações
GIT-FirstPart.pptGIT-FirstPart.ppt
GIT-FirstPart.ppt
ssusered2ec214 visualizações

Mais de ESUG(20)

Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG85 visualizações
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
ESUG20 visualizações
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
ESUG36 visualizações
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
ESUG18 visualizações
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG85 visualizações

Último

Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI Neo4j
10 visualizações41 slides
 Les nouveautés produit Neo4j Les nouveautés produit Neo4j
Les nouveautés produit Neo4jNeo4j
26 visualizações46 slides
DevsRankDevsRank
DevsRankdevsrank786
10 visualizações1 slide
Why Cloud Services.pdfWhy Cloud Services.pdf
Why Cloud Services.pdfPi DATACENTERS
6 visualizações7 slides

Último(20)

Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j10 visualizações
 Les nouveautés produit Neo4j Les nouveautés produit Neo4j
Les nouveautés produit Neo4j
Neo4j26 visualizações
DevsRankDevsRank
DevsRank
devsrank78610 visualizações
Why Cloud Services.pdfWhy Cloud Services.pdf
Why Cloud Services.pdf
Pi DATACENTERS6 visualizações
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel825 visualizações
Tridens DevOpsTridens DevOps
Tridens DevOps
Tridens9 visualizações
Best Mics For Your Live StreamingBest Mics For Your Live Streaming
Best Mics For Your Live Streaming
ontheflystream6 visualizações
BSides Lisbon 2023 - AI in Cybersecurity.pdfBSides Lisbon 2023 - AI in Cybersecurity.pdf
BSides Lisbon 2023 - AI in Cybersecurity.pdf
Tiago Henriques68 visualizações
LAVADORA ROLO.docxLAVADORA ROLO.docx
LAVADORA ROLO.docx
SamuelRamirez835247 visualizações
WebAssemblyWebAssembly
WebAssembly
Jens Siebert30 visualizações
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de producto
Neo4j5 visualizações
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j7 visualizações

Do you really understand Git?