SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
Version Control with SVN
    by Michelangelo van Dam




 PHPBelgium meeting 22/10/2008
       Cafe Sport Leuven

                                 1
                                     1
About me
Michelangelo van Dam
Enterprise PHP Consultant
Zend Certified Engineer
Co-founder PHPBelgium
Contributor Zend Framework
PHP Advocate

E-mail: dragonbe@gmail.com
Blog: http://dragonbe.com
Twitter: http://twitter.com/DragonBe




                                       2
                                           2
About this presentation
• Concepts of version control
• Management with subversion
• Life cycle of a project in subversion
• Parts and structures within subversion
• Advanced subversion tools
• New in release 1.5




                                           3
                                               3
What is version control ?
“Revision control (also known as version
control ...) is the management of multiple
revisions of the same unit of information.”
(source: Wikipedia:RevisionControl)




                                              4
                                                  4
Version Control for PHP devs...
• version control provides
 – management of versions of information
   • code/tests
   • configuration files
   • documentation
 – in a structured, standardized way
 – with repositories
   • centralized (SVN, CVS)
   • decentralized (GIT)



                                           5
                                               5
Why need version control ?
• enables collaboration between developers
• centralized “main code” (trunk)
• custom code alongside main code (branching)
• eases release management (tags)
• rollback to previous revisions
• integration with other tools




                                                6
                                                    6
Subversion (SVN)
• Subversion (http://subversion.tigris.org)
• more advanced than CVS
• less complex than GIT
• integrates well with other tools
  (trac, gforge, jira, ...)
• supported by many tools
  (Zend Studio, TurtoiseSVN, Subversion CLI)



                                               7
                                                   7
An example project in trac




                             8
                                 8
SVN browser in Zend Studio




                             9
                                 9
Code management with SVN
• many developers create much code
• code is committed to a central repository
 – conflicts trigger warnings
• user and groups can be defined
• different versions can co-exist
• access management for named and
  anonymous access rights



                                              10
                                                   10
Subversion authentication
• svnserve daemon
  $ svn svn://server/project/trunk
• svnserve daemon over SSH
  $ svn svn+ssh://server/project/trunk
• Apache webserver
  http://svn.server/project/trunk




                                         11
                                              11
Version management
• all code resides in “trunk”
• code version are detached in “branches”
• snapshots for releases are “tagged”




                                            12
                                                 12
Release management

• a release is a snapshot of a version branch
• are being deployed to server environments
• for live or production environments
  don’t check out in document root !
 – use release folders
   svn co svn://server/myproj/tags/rel-1.0 /web/myproj-rel-1.0

 – create symlink to it
   ln -s /web/myproj-rel-1.0 /web/myproj




                                                             13
                                                                  13
SVN life cycle

                        custom dev branch

        v1.0 v1.1
Trunk
                                       bug fix

                           rel-1.1.1      rel-1.1.2

                    rel-1.0.1     rel-1.0.2


                                                      14
                                                           14
Trunk
• trunk is where all code resides
 – except custom development
• has always the latest version
• is not always the most stable version




                                          15
                                               15
Branch
• two kind of branches exists
 – custom development branches
 – version branches




                                 16
                                      16
Custom development
• code that changes many things in trunk
• are best put in a separate branch
• maintained by their developer(s)
• and merged back into trunk
 – after the merge, the branch is removed
• when changes are done and tested




                                            17
                                                 17
Versions
• are maintained in branches
• have a long lifetime cycle (several years)
• differ from each other
 – because of new code base, framework, language
• have a common base = trunk
• fixes from versions go into trunk
• back port fixes go from trunk into version


                                                   18
                                                        18
Tags
• tags are snapshots
• usually made on version branches
• can also be made on “trunk”
• are deployed (exported) to staging
  environments
• are used to keep track what’s happened
  between releases (change log)



                                           19
                                                19
More than just version control
• Subversion provides more features
 – File portability
 – Keyword substitution
 – Locking
 – Externals
 – Peg and Operative revisions
 – Network model
 – Hooks



                                      20
                                           20
File portability
• Line endings differ on different OSses
 – are ignored when checking modifications
• Mime-types differ from their extensions
 – binary and non-binary files are tested on content




                                                       21
                                                            21
Keyword substitution
• Only a few keywords are substitute
 – $Date:$ › $Date: 2008-10-22 20:00:00 +0100 (Wed,
   22 Oct 2008) $
 – $Revision:$ › $Revision: 144 $
 – $Author:$ › $Author: svnusername $
 – $HeadUrl:$ › $HeadUrl: http://svn.test.be/trunk $
 – $Id:$ › $Id: file.php 148 2008-10-22 20:00:00Z
   svnusername $



                                                       22
                                                            22
Locking
• working copy locks
 – exclusive right to a working copy
 – clears with “svn cleanup”
• database locks
 – ensures database integrity
 – only admins can remove this lock




                                       23
                                            23
Externals
• Externals provide an easy way to
 – include other internal or external projects
 – without having to care about there revisions
• Examples:
 – Zend Framework as svn:externals on library path
 – project that includes many smaller projects




                                                     24
                                                          24
Peg and Operative revisions
• automated handling of
 – moving files
 – deleting and creating new files with same name
• Using specific syntax
 – $ svn command -r OPERATIVE-REV item@PEG-REV




                                                    25
                                                         25
Network model
• Can run it’s own svnserve
 – pros: no dependencies, works with ssh for extra
   security
 – contras: need svnclient to connect
• Or in combination with Apache webserver
 – pros: works with any http-client
 – contras: overkill for small projects, requires
   mod_dav_svn, more difficult to set up



                                                     26
                                                          26
Hooks
• Hooks facilitate actions to be taken
 – before a commit starts (validate rights)
 – after a commit (send e-mail, update tracker, ...)
 – before or after a revision change (notifications)
• Can easily be incorporated with tools
 – tracking tools
 – integration tools (Lorna Jane’s Nabaztag)
 – mailing and logging systems



                                                       27
                                                            27
Hooks execute moments
• basic commit moments:
 – start-commit:
    • runs before commit transaction started
 – pre-commit:
    • runs right before commit transaction is promoted
 – post-commit:
    • runs after the commit transaction is finished
 – ...



                                                         28
                                                              28
Cool things with SVN hooks
   Lorna Jane’s Nabaztag

                     Responding on SVN commits




http://www.flickr.com/photos/lornajane/2592602734/



                                                     29
                                                          29
New features in Subversion v1.5
• Merge tracking (foundational)
• Sparse checkouts (via new --depth option)
• Interactive conflict resolution
• Changelist support
• Relative URLs, peg revisions in svn:externals
• Cyrus SASL support for ra_svn and svnserve
• ... (more on http://subversion.tigris.org/
  svn_1.5_releasenotes.html)

                                                  30
                                                       30
Summary
• manageable file change history
• better collaboration between developers
• clearer release management
• more then one version of same code base
• easier to rollback in case of emergency




                                            31
                                                 31
Thank you...


Questions ?
Michelangelo van Dam - dragonbe@gmail.com
http://slideshare.net/PHPBelgium/version-control-with-svn-presentation




                                                                         32
                                                                              32

Contenu connexe

Tendances

Flyway _ A Database Version Management Tool
Flyway _ A Database Version Management ToolFlyway _ A Database Version Management Tool
Flyway _ A Database Version Management ToolKnoldus Inc.
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command LineAnuchit Chalothorn
 
A Quick Introduction to Linux
A Quick Introduction to LinuxA Quick Introduction to Linux
A Quick Introduction to LinuxTusharadri Sarkar
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentalsRajKharvar
 
Introduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics WorkshopIntroduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics WorkshopSetor Amuzu
 
containerd the universal container runtime
containerd the universal container runtimecontainerd the universal container runtime
containerd the universal container runtimeDocker, Inc.
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchTe-Yen Liu
 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemHungWei Chiu
 
Version control system and Git
Version control system and GitVersion control system and Git
Version control system and Gitramubonkuri
 

Tendances (20)

Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Git basics
Git basicsGit basics
Git basics
 
Flyway _ A Database Version Management Tool
Flyway _ A Database Version Management ToolFlyway _ A Database Version Management Tool
Flyway _ A Database Version Management Tool
 
SVN Basics
SVN BasicsSVN Basics
SVN Basics
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Build Your Own Android Toolchain from scratch
Build Your Own Android Toolchain from scratchBuild Your Own Android Toolchain from scratch
Build Your Own Android Toolchain from scratch
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
 
A Quick Introduction to Linux
A Quick Introduction to LinuxA Quick Introduction to Linux
A Quick Introduction to Linux
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
 
Subversion
SubversionSubversion
Subversion
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Introduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics WorkshopIntroduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics Workshop
 
containerd the universal container runtime
containerd the universal container runtimecontainerd the universal container runtime
containerd the universal container runtime
 
Interrupts on xv6
Interrupts on xv6Interrupts on xv6
Interrupts on xv6
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystem
 
Version control system and Git
Version control system and GitVersion control system and Git
Version control system and Git
 

En vedette

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best PracticesAshraf Fouad
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With SubversionSamnang Chhun
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practicesabackstrom
 
Subversion Best Practices
Subversion Best PracticesSubversion Best Practices
Subversion Best PracticesMatt Wood
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to SubversionAtul Jha
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overviewpolarion
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systemsTim Staley
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?Leonid Mamchenkov
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitCraig Smith
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Getting Started With Subversion
Getting Started With SubversionGetting Started With Subversion
Getting Started With SubversionJordan Hatch
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to gitJoel Krebs
 
Version Control With svn Setting The Stage
Version  Control With svn Setting The StageVersion  Control With svn Setting The Stage
Version Control With svn Setting The Stageparag
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forgeJasmine Conseil
 
Code Management (Version Control)
Code Management (Version Control)Code Management (Version Control)
Code Management (Version Control)Y. Thong Kuah
 
Version Control != Dependency Management
Version Control != Dependency ManagementVersion Control != Dependency Management
Version Control != Dependency ManagementPatrick van Dissel
 
Apache contribution-bar camp-colombo
Apache contribution-bar camp-colomboApache contribution-bar camp-colombo
Apache contribution-bar camp-colomboSagara Gunathunga
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Controlceardach
 
Distributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialDistributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialTed Naleid
 

En vedette (20)

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practices
 
Subversion Best Practices
Subversion Best PracticesSubversion Best Practices
Subversion Best Practices
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to Subversion
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overview
 
Introduce to SVN
Introduce to SVNIntroduce to SVN
Introduce to SVN
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systems
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Getting Started With Subversion
Getting Started With SubversionGetting Started With Subversion
Getting Started With Subversion
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 
Version Control With svn Setting The Stage
Version  Control With svn Setting The StageVersion  Control With svn Setting The Stage
Version Control With svn Setting The Stage
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forge
 
Code Management (Version Control)
Code Management (Version Control)Code Management (Version Control)
Code Management (Version Control)
 
Version Control != Dependency Management
Version Control != Dependency ManagementVersion Control != Dependency Management
Version Control != Dependency Management
 
Apache contribution-bar camp-colombo
Apache contribution-bar camp-colomboApache contribution-bar camp-colombo
Apache contribution-bar camp-colombo
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Control
 
Distributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialDistributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With Mercurial
 

Similaire à Version Control with SVN

PHP Deployment With SVN
PHP Deployment With SVNPHP Deployment With SVN
PHP Deployment With SVNLorna Mitchell
 
Deployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna MitchellDeployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna Mitchelldpc
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-stepMichelangelo van Dam
 
JavaEdge 2008: Your next version control system
JavaEdge 2008: Your next version control systemJavaEdge 2008: Your next version control system
JavaEdge 2008: Your next version control systemGilad Garon
 
Maven, Archiva, Subversion and Team City
Maven, Archiva, Subversion and Team CityMaven, Archiva, Subversion and Team City
Maven, Archiva, Subversion and Team CityBoy Tech
 
betterCode Workshop: Effizientes DevOps-Tooling mit Go
betterCode Workshop:  Effizientes DevOps-Tooling mit GobetterCode Workshop:  Effizientes DevOps-Tooling mit Go
betterCode Workshop: Effizientes DevOps-Tooling mit GoQAware GmbH
 
Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010Pursuit Consulting
 
Supporting Hyper-V 3.0 on Apache CloudStack
Supporting Hyper-V 3.0 on Apache CloudStackSupporting Hyper-V 3.0 on Apache CloudStack
Supporting Hyper-V 3.0 on Apache CloudStackDonal Lafferty
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Kurt Madel
 
Alm tce parallel development
Alm tce parallel developmentAlm tce parallel development
Alm tce parallel developmentshalom938
 
Surviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-studySurviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-studypeter_ibuildings
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and DockerFabio Fumarola
 
Dvcs With Mercurial (No Notes)
Dvcs With Mercurial (No Notes)Dvcs With Mercurial (No Notes)
Dvcs With Mercurial (No Notes)Ted Naleid
 
The Source Control Landscape
The Source Control LandscapeThe Source Control Landscape
The Source Control LandscapeLorna Mitchell
 
Mantis Code Deployment Process
Mantis Code Deployment ProcessMantis Code Deployment Process
Mantis Code Deployment ProcessJen Wei Lee
 

Similaire à Version Control with SVN (20)

PHP Deployment With SVN
PHP Deployment With SVNPHP Deployment With SVN
PHP Deployment With SVN
 
Deployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna MitchellDeployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna Mitchell
 
Versioning for Developers
Versioning for DevelopersVersioning for Developers
Versioning for Developers
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-step
 
JavaEdge 2008: Your next version control system
JavaEdge 2008: Your next version control systemJavaEdge 2008: Your next version control system
JavaEdge 2008: Your next version control system
 
Maven, Archiva, Subversion and Team City
Maven, Archiva, Subversion and Team CityMaven, Archiva, Subversion and Team City
Maven, Archiva, Subversion and Team City
 
betterCode Workshop: Effizientes DevOps-Tooling mit Go
betterCode Workshop:  Effizientes DevOps-Tooling mit GobetterCode Workshop:  Effizientes DevOps-Tooling mit Go
betterCode Workshop: Effizientes DevOps-Tooling mit Go
 
Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010
 
Supporting Hyper-V 3.0 on Apache CloudStack
Supporting Hyper-V 3.0 on Apache CloudStackSupporting Hyper-V 3.0 on Apache CloudStack
Supporting Hyper-V 3.0 on Apache CloudStack
 
Kubernetes Intro
Kubernetes IntroKubernetes Intro
Kubernetes Intro
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015
 
Dockerized maven
Dockerized mavenDockerized maven
Dockerized maven
 
Alm tce parallel development
Alm tce parallel developmentAlm tce parallel development
Alm tce parallel development
 
Surviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-studySurviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-study
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
 
Subversion and bug tracking
Subversion and bug trackingSubversion and bug tracking
Subversion and bug tracking
 
Dvcs With Mercurial (No Notes)
Dvcs With Mercurial (No Notes)Dvcs With Mercurial (No Notes)
Dvcs With Mercurial (No Notes)
 
The Source Control Landscape
The Source Control LandscapeThe Source Control Landscape
The Source Control Landscape
 
Agile Software Development & Tools
Agile Software Development & ToolsAgile Software Development & Tools
Agile Software Development & Tools
 
Mantis Code Deployment Process
Mantis Code Deployment ProcessMantis Code Deployment Process
Mantis Code Deployment Process
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
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, Adobeapidays
 
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 DiscoveryTrustArc
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
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 FMESafe Software
 
"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 ...Zilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
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 WoodJuan lago vázquez
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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
 
"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 ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Version Control with SVN

  • 1. Version Control with SVN by Michelangelo van Dam PHPBelgium meeting 22/10/2008 Cafe Sport Leuven 1 1
  • 2. About me Michelangelo van Dam Enterprise PHP Consultant Zend Certified Engineer Co-founder PHPBelgium Contributor Zend Framework PHP Advocate E-mail: dragonbe@gmail.com Blog: http://dragonbe.com Twitter: http://twitter.com/DragonBe 2 2
  • 3. About this presentation • Concepts of version control • Management with subversion • Life cycle of a project in subversion • Parts and structures within subversion • Advanced subversion tools • New in release 1.5 3 3
  • 4. What is version control ? “Revision control (also known as version control ...) is the management of multiple revisions of the same unit of information.” (source: Wikipedia:RevisionControl) 4 4
  • 5. Version Control for PHP devs... • version control provides – management of versions of information • code/tests • configuration files • documentation – in a structured, standardized way – with repositories • centralized (SVN, CVS) • decentralized (GIT) 5 5
  • 6. Why need version control ? • enables collaboration between developers • centralized “main code” (trunk) • custom code alongside main code (branching) • eases release management (tags) • rollback to previous revisions • integration with other tools 6 6
  • 7. Subversion (SVN) • Subversion (http://subversion.tigris.org) • more advanced than CVS • less complex than GIT • integrates well with other tools (trac, gforge, jira, ...) • supported by many tools (Zend Studio, TurtoiseSVN, Subversion CLI) 7 7
  • 8. An example project in trac 8 8
  • 9. SVN browser in Zend Studio 9 9
  • 10. Code management with SVN • many developers create much code • code is committed to a central repository – conflicts trigger warnings • user and groups can be defined • different versions can co-exist • access management for named and anonymous access rights 10 10
  • 11. Subversion authentication • svnserve daemon $ svn svn://server/project/trunk • svnserve daemon over SSH $ svn svn+ssh://server/project/trunk • Apache webserver http://svn.server/project/trunk 11 11
  • 12. Version management • all code resides in “trunk” • code version are detached in “branches” • snapshots for releases are “tagged” 12 12
  • 13. Release management • a release is a snapshot of a version branch • are being deployed to server environments • for live or production environments don’t check out in document root ! – use release folders svn co svn://server/myproj/tags/rel-1.0 /web/myproj-rel-1.0 – create symlink to it ln -s /web/myproj-rel-1.0 /web/myproj 13 13
  • 14. SVN life cycle custom dev branch v1.0 v1.1 Trunk bug fix rel-1.1.1 rel-1.1.2 rel-1.0.1 rel-1.0.2 14 14
  • 15. Trunk • trunk is where all code resides – except custom development • has always the latest version • is not always the most stable version 15 15
  • 16. Branch • two kind of branches exists – custom development branches – version branches 16 16
  • 17. Custom development • code that changes many things in trunk • are best put in a separate branch • maintained by their developer(s) • and merged back into trunk – after the merge, the branch is removed • when changes are done and tested 17 17
  • 18. Versions • are maintained in branches • have a long lifetime cycle (several years) • differ from each other – because of new code base, framework, language • have a common base = trunk • fixes from versions go into trunk • back port fixes go from trunk into version 18 18
  • 19. Tags • tags are snapshots • usually made on version branches • can also be made on “trunk” • are deployed (exported) to staging environments • are used to keep track what’s happened between releases (change log) 19 19
  • 20. More than just version control • Subversion provides more features – File portability – Keyword substitution – Locking – Externals – Peg and Operative revisions – Network model – Hooks 20 20
  • 21. File portability • Line endings differ on different OSses – are ignored when checking modifications • Mime-types differ from their extensions – binary and non-binary files are tested on content 21 21
  • 22. Keyword substitution • Only a few keywords are substitute – $Date:$ › $Date: 2008-10-22 20:00:00 +0100 (Wed, 22 Oct 2008) $ – $Revision:$ › $Revision: 144 $ – $Author:$ › $Author: svnusername $ – $HeadUrl:$ › $HeadUrl: http://svn.test.be/trunk $ – $Id:$ › $Id: file.php 148 2008-10-22 20:00:00Z svnusername $ 22 22
  • 23. Locking • working copy locks – exclusive right to a working copy – clears with “svn cleanup” • database locks – ensures database integrity – only admins can remove this lock 23 23
  • 24. Externals • Externals provide an easy way to – include other internal or external projects – without having to care about there revisions • Examples: – Zend Framework as svn:externals on library path – project that includes many smaller projects 24 24
  • 25. Peg and Operative revisions • automated handling of – moving files – deleting and creating new files with same name • Using specific syntax – $ svn command -r OPERATIVE-REV item@PEG-REV 25 25
  • 26. Network model • Can run it’s own svnserve – pros: no dependencies, works with ssh for extra security – contras: need svnclient to connect • Or in combination with Apache webserver – pros: works with any http-client – contras: overkill for small projects, requires mod_dav_svn, more difficult to set up 26 26
  • 27. Hooks • Hooks facilitate actions to be taken – before a commit starts (validate rights) – after a commit (send e-mail, update tracker, ...) – before or after a revision change (notifications) • Can easily be incorporated with tools – tracking tools – integration tools (Lorna Jane’s Nabaztag) – mailing and logging systems 27 27
  • 28. Hooks execute moments • basic commit moments: – start-commit: • runs before commit transaction started – pre-commit: • runs right before commit transaction is promoted – post-commit: • runs after the commit transaction is finished – ... 28 28
  • 29. Cool things with SVN hooks Lorna Jane’s Nabaztag Responding on SVN commits http://www.flickr.com/photos/lornajane/2592602734/ 29 29
  • 30. New features in Subversion v1.5 • Merge tracking (foundational) • Sparse checkouts (via new --depth option) • Interactive conflict resolution • Changelist support • Relative URLs, peg revisions in svn:externals • Cyrus SASL support for ra_svn and svnserve • ... (more on http://subversion.tigris.org/ svn_1.5_releasenotes.html) 30 30
  • 31. Summary • manageable file change history • better collaboration between developers • clearer release management • more then one version of same code base • easier to rollback in case of emergency 31 31
  • 32. Thank you... Questions ? Michelangelo van Dam - dragonbe@gmail.com http://slideshare.net/PHPBelgium/version-control-with-svn-presentation 32 32