SlideShare une entreprise Scribd logo
1  sur  28
Planning and Managing Software Projects 2011-12



Revision control systems

Emanuele Della Valle, Lecturer: Daniele Dell’Aglio
http://emanueledellavalle.org
Outline

●    Why revision control
●    Main concepts
●    Basic operations
      –    Checkout
      –    Commit
      –    Update
●    Branches and tags




 Planning and Managing Software Projects – Emanuele Della Valle
Motivations

 When working alone
      • Backup copy                                                         Repository
      • We don’t want to
        lose the history of
        our                                                        F    F      F
        code/documents/etc.                                       r5   r4     r3
                                                                                   ...




                                                                             F
                                                                            r5




 Planning and Managing Software Projects – Emanuele Della Valle
Motivations

 When working alone
      • Backup copy                                                         Repository
      • We don’t want to
        lose the history of
        our                                                        F    F      F
        code/documents/etc.                                       r5   r4     r3
                                                                                   ...


 When working in
  team                                                                                    F
      • Share modifications                                        F                     r5
        easily                                                    r5
      • Support for
        cooperative code                                                       F
        development                                                           r5



 Planning and Managing Software Projects – Emanuele Della Valle
SVN
 There are several version control systems (both open
  and closed source)
      • CVS
      • SVN
      • Perforce
 In the following we will consider SVN
      • The main concept are similar in the other systems
 Several GUIs for SVN are available
      •     TortoiseSVN (Windows)
      •     RabbitVCS (Linux)
      •     Subclipse/Subversive (Eclipse plug-ins)
      •     ...




 Planning and Managing Software Projects – Emanuele Della Valle
Some definitions

                                                                                Repository
                                                                   Repository
                                                                                (the location
                                                                                  where files
                                                                                  are stored)
                                                    F          F      F   ...
                                                   r5         r4     r3




                                                                    F
                                                                   r5




 Planning and Managing Software Projects – Emanuele Della Valle
Some definitions

                                                                                Repository
                                                                   Repository



                                                    F          F      F   ...
                                                   r5         r4     r3




                    Revision
                                                                    F
                    (Version)
                                                                   r5
                (an identifier
                 associated to
                each version of
                   the file)


 Planning and Managing Software Projects – Emanuele Della Valle
Some definitions

                                                                                Repository
                                                                   Repository
             Head
       (the most
     recent version                                 F          F      F   ...
      of the files)                                r5         r4     r3




                     Revision
                                                                    F
                     (Version)
                                                                   r5




 Planning and Managing Software Projects – Emanuele Della Valle
Some definitions

                                                                                        Repository
                                                                   Repository
             Head

                                                    F          F      F   ...
                                                   r5         r4     r3




                     Revision
                                                                    F
                     (Version)
                                                                   r5
                                                                                Working copy
                                                                                 (copy of the
                                                                                  files on the
                                                                                local machine)

 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial                                                         Repository
  creation of the working
  copy from the repository
                                                                    F    F      F   ...
                                                                   r5   r4     r3


                                                                                F
                                                                               r5




                                                                  svn checkout <URL>



 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial                                                        Repository
  creation of the working
  copy from the repository
                                                                   F    F      F   ...
                                                                  r5   r4     r3




                                                                             F
                                                                            r5




 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial                                                        Repository
  creation of the working
  copy from the repository
                                                                   F    F      F   ...
                                                                  r5   r4     r3




                                                                             F
                                                                            r5*




 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                                  Repository
  of the working copy from
  the repository
 Check-in (Commit):                                                F      F      F   ...
                                                                   r5     r4     r3
  update of the HEAD
  revision with the working
  copy                                                                   F
                                                                        r5*

                                                                                F
                                                                               r5*


                                                                  svn commit



 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                                Repository
  of the working copy from
  the repository
 Check-in (Commit):                                                F    F      F   ...
                                                                   r6   r5     r4
  update of the HEAD
  revision with the working
  copy


                                                                              F
                                                                             r6


                                                                  svn commit



 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                               Repository
  of the working copy from
  the repository
 Check-in (Commit):                                               F    F      F   ...
                                                                  r6   r5     r4
  update of the HEAD
  revision with the working
  copy


                                                                             F
                                                                            r6*




 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                                Repository
  of the working copy from
  the repository
 Check-in (Commit):                                                F    F      F   ...
                                                                   r6   r5     r4
  update of the HEAD
  revision with the working
  copy                                                                          F
                                                                               r6
 Revert: drop the
  modification on the                                                         F
  working copy and reset                                                     r6*
  the files to HEAD

                                                                  svn revert <file>



 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                               Repository
  of the working copy from
  the repository
 Check-in (Commit):                                               F    F      F   ...
                                                                  r6   r5     r4
  update of the HEAD
  revision with the working
  copy
 Revert: drop the
  modification on the                                                        F
  working copy and reset                                                    r6
  the files to HEAD




 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                               Repository
  of the working copy from
  the repository
 Check-in (Commit):                                               F    F      F   ...
                                                                  r6   r5     r4
  update of the HEAD
  revision with the working
  copy
 Revert: drop the
  modification on the                                                        F
  working copy and reset                                                    r6*
  the files to HEAD




 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                               Repository
  of the working copy from
  the repository
 Check-in (Commit):                                               F    F      F   ...
                                                                  r9   r8     r7
  update of the HEAD
  revision with the working
  copy
 Revert: drop the
  modification on the                                                        F
  working copy and reset                                                    r6*
  the files to HEAD




 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                                Repository
  of the working copy from
  the repository
 Check-in (Commit):                                                F    F      F   ...
                                                                   r9   r8     r7
  update of the HEAD
  revision with the working
  copy                                                                          F
                                                                               r9
 Revert: drop the
  modification on the                                                         F
  working copy and reset                                                     r6*
  the files to HEAD
 Update: merge HEAD                                              svn update
  and the working copy


 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 Check-out: initial creation                                               Repository
  of the working copy from
  the repository
 Check-in (Commit):                                               F    F      F   ...
                                                                  r9   r8     r7
  update of the HEAD
  revision with the working
  copy
 Revert: drop the
  modification on the                                                        F
  working copy and reset                                                    r9*
  the files to HEAD
 Update: merge HEAD
  and the working copy


 Planning and Managing Software Projects – Emanuele Della Valle
Main operations
 The main commands we see in the previous slides are
  • svn checkout <URL>
  • svn commit
  • svn revert <file>
  • svn update
 Two additional important commands are:
  • svn add <file> [<file>...]
  • svn delete <file> [<file>...]
 add and delete respectively adds and removes
  files in/from the working copy
      • Those operations should then be confirmed (with a
        commit) or cancelled (through a revert)



 Planning and Managing Software Projects – Emanuele Della Valle
Conflicts
 A conflict occours when the system is unable to
  automatically merge a working copy with the HEAD
  revision
 Usually this issue can be found when developing in
  team
 Example:
      •     Two users check-out the same release
      •     They both modify the same files in their working copy
      •     The first user commits his working copy
      •     The second one tries to commit and the system is
            unable to merge
 Best practice: before committing, do an update and
  resolve the conflict locally!


 Planning and Managing Software Projects – Emanuele Della Valle
Branches
 A branch is a copy of the project
      • The original is stored in the Trunk
 It is maintained separately

                                                                      Trunk
                                                                  Branch 2
                                           Branch 1
 There is only one trunk, while there are zero or more
  branches
      • Example: team works in separated branches to include
        new features
 SVN doesn’t have a dedicated command to create
  branches:
                                        svn copy <from> <to>
 Planning and Managing Software Projects – Emanuele Della Valle
Merges
 Modifications done in the branches should then be
  applied to the trunk/other branches
 In general, merge in SVN:
      • Compares two different trees
      • Extract the differences between the two trees
      • Differences are applied to the working copy
 The merge command is
                           svn merge –r<from>:<to> <url>
 As other operations, merge is done locally
      • It should be committed (or reverted)




 Planning and Managing Software Projects – Emanuele Della Valle
Tags
 Tags identify relevant revisions
 Each tag is a label associated to a revision
 Tags can be used to identify
      • Milestones
      • Software releases



                                                                              Repository


                                    release-1.1                    release-1.0


                                 F
                                 FF         F
                                            FF          F
                                                        FF         F
                                                                   FF    F
                                                                         FF      F
                                                                                 FF   ...
                                r9
                                r8
                                 r8        r8
                                           r8
                                            r8         r7
                                                       r8
                                                        r8        r6
                                                                  r8
                                                                   r8   r5
                                                                        r8
                                                                         r8     r4
                                                                                r8
                                                                                 r8



 Planning and Managing Software Projects – Emanuele Della Valle
Distributed version control systems
 Distributed version control systems are an alternative
  to che (centralized) version control systems
 They adopt a peer to peer approach instead of a
  server-client one
      • Several distributed repositories
 Examples of distributed version control systems
      • Git
      • Mercurial
      • Baazar




 Planning and Managing Software Projects – Emanuele Della Valle
Useful links
 Version Control with Subversion http://svnbook.red-
  bean.com/
 A Visual Guide to Version Control
  http://betterexplained.com/articles/a-visual-guide-to-
  version-control/
 Pro Git http://git-scm.com/book




 Planning and Managing Software Projects – Emanuele Della Valle

Contenu connexe

Plus de Daniele Dell'Aglio

On correctness in RDF stream processor benchmarking
On correctness in RDF stream processor benchmarkingOn correctness in RDF stream processor benchmarking
On correctness in RDF stream processor benchmarking
Daniele Dell'Aglio
 
P&MSP2012 - Logging Frameworks
P&MSP2012 - Logging FrameworksP&MSP2012 - Logging Frameworks
P&MSP2012 - Logging Frameworks
Daniele Dell'Aglio
 

Plus de Daniele Dell'Aglio (19)

Distributed stream consistency checking
Distributed stream consistency checkingDistributed stream consistency checking
Distributed stream consistency checking
 
On web stream processing
On web stream processingOn web stream processing
On web stream processing
 
On a web of data streams
On a web of data streamsOn a web of data streams
On a web of data streams
 
Triplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the WebTriplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the Web
 
On unifying query languages for RDF streams
On unifying query languages for RDF streamsOn unifying query languages for RDF streams
On unifying query languages for RDF streams
 
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...
 
Summary of the Stream Reasoning workshop at ISWC 2016
Summary of the Stream Reasoning workshop at ISWC 2016Summary of the Stream Reasoning workshop at ISWC 2016
Summary of the Stream Reasoning workshop at ISWC 2016
 
On Unified Stream Reasoning
On Unified Stream ReasoningOn Unified Stream Reasoning
On Unified Stream Reasoning
 
On Unified Stream Reasoning - The RDF Stream Processing realm
On Unified Stream Reasoning - The RDF Stream Processing realmOn Unified Stream Reasoning - The RDF Stream Processing realm
On Unified Stream Reasoning - The RDF Stream Processing realm
 
Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1
 
Augmented Participation to Live Events through Social Network Content Enrichm...
Augmented Participation to Live Events through Social Network Content Enrichm...Augmented Participation to Live Events through Social Network Content Enrichm...
Augmented Participation to Live Events through Social Network Content Enrichm...
 
An experience on empirical research about rdf stream
An experience on empirical research about rdf streamAn experience on empirical research about rdf stream
An experience on empirical research about rdf stream
 
A Survey of Temporal Extensions of Description Logics
A Survey of Temporal Extensions of Description LogicsA Survey of Temporal Extensions of Description Logics
A Survey of Temporal Extensions of Description Logics
 
IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)
IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)
IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)
 
Ontology based top-k query answering over massive, heterogeneous, and dynamic...
Ontology based top-k query answering over massive, heterogeneous, and dynamic...Ontology based top-k query answering over massive, heterogeneous, and dynamic...
Ontology based top-k query answering over massive, heterogeneous, and dynamic...
 
On correctness in RDF stream processor benchmarking
On correctness in RDF stream processor benchmarkingOn correctness in RDF stream processor benchmarking
On correctness in RDF stream processor benchmarking
 
An Ontological Formulation and an OPM profile for Causality in Planning Appli...
An Ontological Formulation and an OPM profile for Causality in Planning Appli...An Ontological Formulation and an OPM profile for Causality in Planning Appli...
An Ontological Formulation and an OPM profile for Causality in Planning Appli...
 
P&MSP2012 - Maven
P&MSP2012 - MavenP&MSP2012 - Maven
P&MSP2012 - Maven
 
P&MSP2012 - Logging Frameworks
P&MSP2012 - Logging FrameworksP&MSP2012 - Logging Frameworks
P&MSP2012 - Logging Frameworks
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

P&MSP2012 - Version Control Systems

  • 1. Planning and Managing Software Projects 2011-12 Revision control systems Emanuele Della Valle, Lecturer: Daniele Dell’Aglio http://emanueledellavalle.org
  • 2. Outline ● Why revision control ● Main concepts ● Basic operations – Checkout – Commit – Update ● Branches and tags Planning and Managing Software Projects – Emanuele Della Valle
  • 3. Motivations  When working alone • Backup copy Repository • We don’t want to lose the history of our F F F code/documents/etc. r5 r4 r3 ... F r5 Planning and Managing Software Projects – Emanuele Della Valle
  • 4. Motivations  When working alone • Backup copy Repository • We don’t want to lose the history of our F F F code/documents/etc. r5 r4 r3 ...  When working in team F • Share modifications F r5 easily r5 • Support for cooperative code F development r5 Planning and Managing Software Projects – Emanuele Della Valle
  • 5. SVN  There are several version control systems (both open and closed source) • CVS • SVN • Perforce  In the following we will consider SVN • The main concept are similar in the other systems  Several GUIs for SVN are available • TortoiseSVN (Windows) • RabbitVCS (Linux) • Subclipse/Subversive (Eclipse plug-ins) • ... Planning and Managing Software Projects – Emanuele Della Valle
  • 6. Some definitions Repository Repository (the location where files are stored) F F F ... r5 r4 r3 F r5 Planning and Managing Software Projects – Emanuele Della Valle
  • 7. Some definitions Repository Repository F F F ... r5 r4 r3 Revision F (Version) r5 (an identifier associated to each version of the file) Planning and Managing Software Projects – Emanuele Della Valle
  • 8. Some definitions Repository Repository Head (the most recent version F F F ... of the files) r5 r4 r3 Revision F (Version) r5 Planning and Managing Software Projects – Emanuele Della Valle
  • 9. Some definitions Repository Repository Head F F F ... r5 r4 r3 Revision F (Version) r5 Working copy (copy of the files on the local machine) Planning and Managing Software Projects – Emanuele Della Valle
  • 10. Main operations  Check-out: initial Repository creation of the working copy from the repository F F F ... r5 r4 r3 F r5 svn checkout <URL> Planning and Managing Software Projects – Emanuele Della Valle
  • 11. Main operations  Check-out: initial Repository creation of the working copy from the repository F F F ... r5 r4 r3 F r5 Planning and Managing Software Projects – Emanuele Della Valle
  • 12. Main operations  Check-out: initial Repository creation of the working copy from the repository F F F ... r5 r4 r3 F r5* Planning and Managing Software Projects – Emanuele Della Valle
  • 13. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r5 r4 r3 update of the HEAD revision with the working copy F r5* F r5* svn commit Planning and Managing Software Projects – Emanuele Della Valle
  • 14. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r6 r5 r4 update of the HEAD revision with the working copy F r6 svn commit Planning and Managing Software Projects – Emanuele Della Valle
  • 15. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r6 r5 r4 update of the HEAD revision with the working copy F r6* Planning and Managing Software Projects – Emanuele Della Valle
  • 16. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r6 r5 r4 update of the HEAD revision with the working copy F r6  Revert: drop the modification on the F working copy and reset r6* the files to HEAD svn revert <file> Planning and Managing Software Projects – Emanuele Della Valle
  • 17. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r6 r5 r4 update of the HEAD revision with the working copy  Revert: drop the modification on the F working copy and reset r6 the files to HEAD Planning and Managing Software Projects – Emanuele Della Valle
  • 18. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r6 r5 r4 update of the HEAD revision with the working copy  Revert: drop the modification on the F working copy and reset r6* the files to HEAD Planning and Managing Software Projects – Emanuele Della Valle
  • 19. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r9 r8 r7 update of the HEAD revision with the working copy  Revert: drop the modification on the F working copy and reset r6* the files to HEAD Planning and Managing Software Projects – Emanuele Della Valle
  • 20. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r9 r8 r7 update of the HEAD revision with the working copy F r9  Revert: drop the modification on the F working copy and reset r6* the files to HEAD  Update: merge HEAD svn update and the working copy Planning and Managing Software Projects – Emanuele Della Valle
  • 21. Main operations  Check-out: initial creation Repository of the working copy from the repository  Check-in (Commit): F F F ... r9 r8 r7 update of the HEAD revision with the working copy  Revert: drop the modification on the F working copy and reset r9* the files to HEAD  Update: merge HEAD and the working copy Planning and Managing Software Projects – Emanuele Della Valle
  • 22. Main operations  The main commands we see in the previous slides are • svn checkout <URL> • svn commit • svn revert <file> • svn update  Two additional important commands are: • svn add <file> [<file>...] • svn delete <file> [<file>...]  add and delete respectively adds and removes files in/from the working copy • Those operations should then be confirmed (with a commit) or cancelled (through a revert) Planning and Managing Software Projects – Emanuele Della Valle
  • 23. Conflicts  A conflict occours when the system is unable to automatically merge a working copy with the HEAD revision  Usually this issue can be found when developing in team  Example: • Two users check-out the same release • They both modify the same files in their working copy • The first user commits his working copy • The second one tries to commit and the system is unable to merge  Best practice: before committing, do an update and resolve the conflict locally! Planning and Managing Software Projects – Emanuele Della Valle
  • 24. Branches  A branch is a copy of the project • The original is stored in the Trunk  It is maintained separately Trunk Branch 2 Branch 1  There is only one trunk, while there are zero or more branches • Example: team works in separated branches to include new features  SVN doesn’t have a dedicated command to create branches: svn copy <from> <to> Planning and Managing Software Projects – Emanuele Della Valle
  • 25. Merges  Modifications done in the branches should then be applied to the trunk/other branches  In general, merge in SVN: • Compares two different trees • Extract the differences between the two trees • Differences are applied to the working copy  The merge command is svn merge –r<from>:<to> <url>  As other operations, merge is done locally • It should be committed (or reverted) Planning and Managing Software Projects – Emanuele Della Valle
  • 26. Tags  Tags identify relevant revisions  Each tag is a label associated to a revision  Tags can be used to identify • Milestones • Software releases Repository release-1.1 release-1.0 F FF F FF F FF F FF F FF F FF ... r9 r8 r8 r8 r8 r8 r7 r8 r8 r6 r8 r8 r5 r8 r8 r4 r8 r8 Planning and Managing Software Projects – Emanuele Della Valle
  • 27. Distributed version control systems  Distributed version control systems are an alternative to che (centralized) version control systems  They adopt a peer to peer approach instead of a server-client one • Several distributed repositories  Examples of distributed version control systems • Git • Mercurial • Baazar Planning and Managing Software Projects – Emanuele Della Valle
  • 28. Useful links  Version Control with Subversion http://svnbook.red- bean.com/  A Visual Guide to Version Control http://betterexplained.com/articles/a-visual-guide-to- version-control/  Pro Git http://git-scm.com/book Planning and Managing Software Projects – Emanuele Della Valle