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 sur 45

Recommandé

An introduction to Git. par
An introduction to Git.An introduction to Git.
An introduction to Git.Sten Govaerts
755 vues29 diapositives
Do you really understand git? par
Do you really understand git?Do you really understand git?
Do you really understand git?ESUG
2.3K vues42 diapositives
Git censored.key par
Git censored.keyGit censored.key
Git censored.keymkramer2
922 vues85 diapositives
Open Source Tools for Leveling Up Operations FOSSET 2014 par
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 vues88 diapositives
Git - Some tips to do it better par
Git - Some tips to do it betterGit - Some tips to do it better
Git - Some tips to do it betterJonas De Smet
2.8K vues27 diapositives
Dive into .git par
Dive into .gitDive into .git
Dive into .gitnishio
1.1K vues19 diapositives

Contenu connexe

Similaire à Do you really understand Git?

Giving back with GitHub - Putting the Open Source back in iOS par
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 vues31 diapositives
Github basics par
Github basicsGithub basics
Github basicsRadoslav Georgiev
16.9K vues28 diapositives
Gitting the Most From Git par
Gitting the Most From GitGitting the Most From Git
Gitting the Most From GitChris Miller
959 vues84 diapositives
Clean Manifests with Puppet::Tidy par
Clean Manifests with Puppet::TidyClean Manifests with Puppet::Tidy
Clean Manifests with Puppet::TidyPuppet
4.5K vues51 diapositives
Git One Day Training Notes par
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
3.5K vues67 diapositives
C# - Raise the bar with functional & immutable constructs (Dutch) par
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 vues29 diapositives

Similaire à Do you really understand Git?(20)

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

Plus de ESUG

Workshop: Identifying concept inventories in agile programming par
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
12 vues16 diapositives
Technical documentation support in Pharo par
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
31 vues39 diapositives
The Pharo Debugger and Debugging tools: Advances and Roadmap par
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 vues44 diapositives
Sequence: Pipeline modelling in Pharo par
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
87 vues22 diapositives
Migration process from monolithic to micro frontend architecture in mobile ap... par
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 vues35 diapositives
Analyzing Dart Language with Pharo: Report and early results par
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
108 vues30 diapositives

Plus de ESUG(20)

Workshop: Identifying concept inventories in agile programming par ESUG
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG12 vues
Technical documentation support in Pharo par ESUG
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
ESUG31 vues
The Pharo Debugger and Debugging tools: Advances and Roadmap par 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 vues
Sequence: Pipeline modelling in Pharo par ESUG
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG87 vues
Migration process from monolithic to micro frontend architecture in mobile ap... par 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 vues
Analyzing Dart Language with Pharo: Report and early results par 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
ESUG108 vues
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6 par 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
ESUG39 vues
A Unit Test Metamodel for Test Generation par ESUG
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG54 vues
Creating Unit Tests Using Genetic Programming par ESUG
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG49 vues
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes par 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 vues
Exploring GitHub Actions through EGAD: An Experience Report par 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 vues
Pharo: a reflective language A first systematic analysis of reflective APIs par 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
ESUG58 vues
Garbage Collector Tuning par ESUG
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
ESUG20 vues
Improving Performance Through Object Lifetime Profiling: the DataFrame Case par 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 vues
Pharo DataFrame: Past, Present, and Future par ESUG
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG43 vues
thisContext in the Debugger par ESUG
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
ESUG36 vues
Websockets for Fencing Score par ESUG
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
ESUG18 vues
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript par 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 vues
Advanced Object- Oriented Design Mooc par ESUG
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG85 vues
A New Architecture Reconciling Refactorings and Transformations par ESUG
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG28 vues

Dernier

Using Qt under LGPL-3.0 par
Using Qt under LGPL-3.0Using Qt under LGPL-3.0
Using Qt under LGPL-3.0Burkhard Stubert
13 vues11 diapositives
Programming Field par
Programming FieldProgramming Field
Programming Fieldthehardtechnology
6 vues9 diapositives
EV Charging App Case par
EV Charging App Case EV Charging App Case
EV Charging App Case iCoderz Solutions
9 vues1 diapositive
The Path to DevOps par
The Path to DevOpsThe Path to DevOps
The Path to DevOpsJohn Valentino
5 vues6 diapositives
Ports-and-Adapters Architecture for Embedded HMI par
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIBurkhard Stubert
29 vues19 diapositives
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... par
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...NimaTorabi2
16 vues17 diapositives

Dernier(20)

Ports-and-Adapters Architecture for Embedded HMI par Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... par 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...
NimaTorabi216 vues
Electronic AWB - Electronic Air Waybill par Freightoscope
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill
AI and Ml presentation .pptx par FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8714 vues
360 graden fabriek par info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492162 vues
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... par Stefan Wolpers
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
Stefan Wolpers33 vues
Transport Management System - Shipment & Container Tracking par Freightoscope
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container Tracking
tecnologia18.docx par nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 vues
predicting-m3-devopsconMunich-2023-v2.pptx par Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app11 vues
How Workforce Management Software Empowers SMEs | TraQSuite par TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuite
TraQSuite6 vues

Do you really understand Git?