SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Mehr von 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
 

Mehr von 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
 

KĂźrzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

KĂźrzlich hochgeladen (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

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