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. por
An introduction to Git.An introduction to Git.
An introduction to Git.Sten Govaerts
755 vistas29 diapositivas
Do you really understand git? por
Do you really understand git?Do you really understand git?
Do you really understand git?ESUG
2.3K vistas42 diapositivas
Git censored.key por
Git censored.keyGit censored.key
Git censored.keymkramer2
922 vistas85 diapositivas
Open Source Tools for Leveling Up Operations FOSSET 2014 por
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Mandi Walls
1.2K vistas88 diapositivas
Git - Some tips to do it better por
Git - Some tips to do it betterGit - Some tips to do it better
Git - Some tips to do it betterJonas De Smet
2.8K vistas27 diapositivas
Dive into .git por
Dive into .gitDive into .git
Dive into .gitnishio
1.1K vistas19 diapositivas

Más contenido relacionado

Similar a Do you really understand Git?

Giving back with GitHub - Putting the Open Source back in iOS por
Giving back with GitHub - Putting the Open Source back in iOSGiving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOSMadhava Jay
350 vistas31 diapositivas
Github basics por
Github basicsGithub basics
Github basicsRadoslav Georgiev
16.9K vistas28 diapositivas
Gitting the Most From Git por
Gitting the Most From GitGitting the Most From Git
Gitting the Most From GitChris Miller
959 vistas84 diapositivas
Clean Manifests with Puppet::Tidy por
Clean Manifests with Puppet::TidyClean Manifests with Puppet::Tidy
Clean Manifests with Puppet::TidyPuppet
4.5K vistas51 diapositivas
Git One Day Training Notes por
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
3.5K vistas67 diapositivas
C# - Raise the bar with functional & immutable constructs (Dutch) por
C# - Raise the bar with functional & immutable constructs (Dutch)C# - Raise the bar with functional & immutable constructs (Dutch)
C# - Raise the bar with functional & immutable constructs (Dutch)Rick Beerendonk
1.2K vistas29 diapositivas

Similar a Do you really understand Git?(20)

Giving back with GitHub - Putting the Open Source back in iOS por Madhava Jay
Giving back with GitHub - Putting the Open Source back in iOSGiving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOS
Madhava Jay350 vistas
Gitting the Most From Git por Chris Miller
Gitting the Most From GitGitting the Most From Git
Gitting the Most From Git
Chris Miller959 vistas
Clean Manifests with Puppet::Tidy por Puppet
Clean Manifests with Puppet::TidyClean Manifests with Puppet::Tidy
Clean Manifests with Puppet::Tidy
Puppet4.5K vistas
Git One Day Training Notes por glen_a_smith
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith3.5K vistas
C# - Raise the bar with functional & immutable constructs (Dutch) por Rick Beerendonk
C# - Raise the bar with functional & immutable constructs (Dutch)C# - Raise the bar with functional & immutable constructs (Dutch)
C# - Raise the bar with functional & immutable constructs (Dutch)
Rick Beerendonk1.2K vistas
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014. por Mandi Walls
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.
Mandi Walls962 vistas
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git por Nicola Costantino
Git Is A State Of Mind - The path to becoming a Master of the mystic art of GitGit Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Nicola Costantino2.2K vistas
Source andassetcontrolingamedev por Matt Benic
Source andassetcontrolingamedevSource andassetcontrolingamedev
Source andassetcontrolingamedev
Matt Benic196 vistas
Source control management por Owen Winkler
Source control managementSource control management
Source control management
Owen Winkler1.2K vistas
Git Things Done por FITC
Git Things DoneGit Things Done
Git Things Done
FITC1.8K vistas
Enterprise git por Pedro Melo
Enterprise gitEnterprise git
Enterprise git
Pedro Melo547 vistas
Community and Github: 7/27/2011 por Andy Lester
Community and Github: 7/27/2011Community and Github: 7/27/2011
Community and Github: 7/27/2011
Andy Lester1.6K vistas
Github for Serious Business Professional por zwheller
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professional
zwheller1.1K vistas
Git for folk who like GUIs por Tim Osborn
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn2.3K vistas

Más de ESUG

Workshop: Identifying concept inventories in agile programming por
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
12 vistas16 diapositivas
Technical documentation support in Pharo por
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
31 vistas39 diapositivas
The Pharo Debugger and Debugging tools: Advances and Roadmap por
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
56 vistas44 diapositivas
Sequence: Pipeline modelling in Pharo por
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
86 vistas22 diapositivas
Migration process from monolithic to micro frontend architecture in mobile ap... por
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
23 vistas35 diapositivas
Analyzing Dart Language with Pharo: Report and early results por
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
107 vistas30 diapositivas

Más de ESUG(20)

Workshop: Identifying concept inventories in agile programming por ESUG
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG12 vistas
Technical documentation support in Pharo por ESUG
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
ESUG31 vistas
The Pharo Debugger and Debugging tools: Advances and Roadmap por ESUG
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG56 vistas
Sequence: Pipeline modelling in Pharo por ESUG
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG86 vistas
Migration process from monolithic to micro frontend architecture in mobile ap... por ESUG
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG23 vistas
Analyzing Dart Language with Pharo: Report and early results por ESUG
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG107 vistas
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6 por ESUG
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG38 vistas
A Unit Test Metamodel for Test Generation por ESUG
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG53 vistas
Creating Unit Tests Using Genetic Programming por ESUG
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG48 vistas
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes por ESUG
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG52 vistas
Exploring GitHub Actions through EGAD: An Experience Report por ESUG
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG17 vistas
Pharo: a reflective language A first systematic analysis of reflective APIs por ESUG
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG57 vistas
Garbage Collector Tuning por ESUG
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
ESUG20 vistas
Improving Performance Through Object Lifetime Profiling: the DataFrame Case por ESUG
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG43 vistas
Pharo DataFrame: Past, Present, and Future por ESUG
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG43 vistas
thisContext in the Debugger por ESUG
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
ESUG36 vistas
Websockets for Fencing Score por ESUG
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
ESUG18 vistas
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript por ESUG
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ESUG46 vistas
Advanced Object- Oriented Design Mooc por ESUG
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG85 vistas
A New Architecture Reconciling Refactorings and Transformations por ESUG
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG28 vistas

Último

Flask-Python.pptx por
Flask-Python.pptxFlask-Python.pptx
Flask-Python.pptxTriloki Gupta
7 vistas12 diapositivas
ShortStory_qlora.pptx por
ShortStory_qlora.pptxShortStory_qlora.pptx
ShortStory_qlora.pptxpranathikrishna22
5 vistas10 diapositivas
EV Charging App Case por
EV Charging App Case EV Charging App Case
EV Charging App Case iCoderz Solutions
9 vistas1 diapositiva
Introduction to Gradle por
Introduction to GradleIntroduction to Gradle
Introduction to GradleJohn Valentino
5 vistas7 diapositivas
FOSSLight Community Day 2023-11-30 por
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30Shane Coughlan
6 vistas18 diapositivas
What is API por
What is APIWhat is API
What is APIartembondar5
10 vistas15 diapositivas

Último(20)

FOSSLight Community Day 2023-11-30 por Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan6 vistas
How Workforce Management Software Empowers SMEs | TraQSuite por TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuite
TraQSuite5 vistas
Generic or specific? Making sensible software design decisions por Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
Quality Engineer: A Day in the Life por John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino7 vistas
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports por Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
FIMA 2023 Neo4j & FS - Entity Resolution.pptx por Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j17 vistas
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... por NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi215 vistas
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... por Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller41 vistas
Fleet Management Software in India por Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable12 vistas
Bootstrapping vs Venture Capital.pptx por Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic14 vistas
predicting-m3-devopsconMunich-2023.pptx por Tier1 app
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptx
Tier1 app7 vistas
360 graden fabriek por info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492143 vistas

Do you really understand Git?