SlideShare ist ein Scribd-Unternehmen logo
1 von 66
SVN BASIC TUTORIAL

Formatvorlage des Untertitelmasters
      Avoiding headaches ™
     durch Klicken bearbeiten
Direct deploy

Developer 1   Staging   Live

Developer 2   Staging   Live

Designer 1    Staging   Live

Designer 2    Staging   Live
Removal of direct deploy

Developer 1   Staging   Live

Developer 2   Staging   Live

 Designer 1   Staging   Live

 Designer 2   Staging   Live
Why not to directly deploy
• Can’t check the status of the environment
• Race conditions (DEV1 and DEV2 work on a
  same file => collisions)
• Can’t easily update the environment (full
  replace of the entire working copy needed)
SVN
• Subversion (SVN) is a SCM (Software
  Configuration Management) implementation
• It allows to track changes in files and
  directories
• It allows concurrent development on the
  same files
• It is centralized (one server)
SVN Interaction
                           Designer 2
              Designer 1                Staging Server



   Developer 2                                     Issue Tracker




Developer 1            SVN Server                    Production Server
SVN development cycle

             Get last project status from SVN server




Send work to SVN server                      Develop/Design




                              Test
SVN development (in SVN terms)

                 svn update




    svn commit                edit files




                    Test
How it works


Will make some examples with TortoiseSVN and
       the command line to explain SVN
Fetching an existing project
Fetching an existing project
Fetching an existing project
Fetching an existing project
Fetching an existing project




The «.svn» directory is used by subversion to keep track of changes in the current
directory tree.
Do not change it, copy it somewhere else or delete it!
Fetching an existing project
Adding some files to the project
Adding some files to the project
Adding some files to the project
Adding some files to the project
Adding some files to the project
Updating working copy
Updating working copy
Updating working copy
Deploy with SVN
When having SSH access to a server, deploying
and updating becomes as easy as:

 $ ssh user@server.com
 $ cd path/to/project
 $ svn update
(Or "svn co" if the project is not yet deployed)
Merging and conflicts
In the following schema, two developers try to
commit changes to a same file:
                    echo ‘hello to’;
Developer 1         echo $username;

                    echo ‘hello world ’;
Developer 2         echo $_GET[‘username’];


RED = changed by developer
How merging works
When Developer 2 tries to commit, SVN will tell him
that his copy is outdated, he will have to update it
How merging works
How merging works
Merging won’t cause any changes on the server, you will first
get all the changes locally, so that you can review them. Here’s
the result of this merge case:




 We can then

 $ svn commit -m "Merged changes of marco’s commit"
Merging workflow
                           svn commit




Developer verifies merge         Can’t commit (outdated working copy)




           svn tries to merge           svn update
What if SVN can’t merge?
                        svn commit




SVN couldn’t merge
                              Can’t commit (outdated working copy)
    ????????




        svn tries to merge           svn update
SVN Conflicts
SVN conflicts happen when two developers act on a
same file in the same line:

                    echo ‘hello everybody’;
Developer 1         echo $_GET[‘username’];

                    echo ‘goodbye everybody’;
Developer 2         echo $_GET[‘username’];

RED = changed by developer
SVN Conflicts
SVN Conflicts
• index.php is a merged view of the conflict:

•
• index.php.r8 is the version before the update
• index.php.r9 is the version as in SVN server
• index.php.mine is the version you had in your
  directory before committing
SVN Conflicts
We can edit the files until all conflicts are solved,
then tell SVN it should accept our new working
copy:
SVN Conflicts
                                 svn commit




    Mark conflicts as resolved                Can’t commit (outdated working copy)




Manually edit conflicts                                         svn update




               SVN couldn’t merge         svn tries to merge
Parallel development
SVN branching
Main project

                       Next major version update
The main project and it’s features
                                             Bugfix for a known bug
                      Keeps track of changes to be merged into the next major release of the software
                                                                    New feature that has to be added
                                            Work in progress to fix a known bug
                                                                                         Alternate version to show to the customer
                                                                   A new feature that requires some work without being influenced b

                                                                                          A slightly different version of the site that t
This is actually how
git-flow by nvie.com
handles development,
but SVN could also use
it!
What is a branch?
In SVN terms, a branch is just a copy of a
  current tree. Let’s create a branch to
  develop an alternate layout for the site:
  svn copy -m “creating green site dev branch”
      svn://path/to/repo/trunk
      svn://path/to/repo/branches/wide-layout

  (in TortoiseSVN it is under “branch/tag” in
     context menu)
Switching working copy
Given that you checked out:


   svn://project/path/trunk

You can now switch to a branch by doing


   svn switch svn://project/path/branches/red

and you will be working on that copy
Merging branches
Once completed developing on a branch, you may
 want to merge changes back:
Merging branches



Like normal conflict merging!
First you switch to the branch you want
        changes to be merged to:



 $ svn switch svn://path/to/target/branch
Then you merge a set of revision from the
  branch you developed on (here 25 to
                latest):

$ svn merge -r25:HEAD svn://path/to/merged/branch
Then SVN will merge any conflicts or set
 conflicted state and allow you to check
  what happened. After fixing conflicts:


$ svn ci -m “merging changes from new-layout branch”
Tags
Tags are markers used for deployment,
  mainly for major release versions:
Tags
Tags are copies, exactly like branches:


  $ svn copy
      -m “tagging version 1.1 of the project”
      svn://path/to/project
      svn://path/to/tags/1.1


Except that you NEVER commit on tags!
svn:externals
Externals are “links” to other repositories:

 $ svn propset svn:externals
    “css/common svn://company/common/css/files”
    ./


    Externals are not part of the repository, they are
 just fetched with the repository (useful for deploying
 applications!)
Best practices
Update your projects before working
Do not commit broken code/functionality!

  (Test before committing if possible!)
Commit as soon as a piece of the
   functionality is completed
Branch life should not be too long



  Long living branches increase merge
                 conflicts!



This forces you to keep small units of work
Every commit should have a purpose.
 Commits with no purpose to be avoided!


   If possible, avoid multiple commits on
separate files being part of one functionality
Never commit generated code/data!



Generated code can produce dozens of useless commits,
          conflicts and generally, headaches!
EVERY
  COMMIT
  MUST
   HAVE
DESCRIPTION
Examples of BAD commit messages:

-
    “Fixed bug”
-
    “Updated”
-
    “Saved work”
-
    “Updating”
-
    “Merging changes”
-
    “Saving work of 10/3/2010”
Examples of GOOD commit messages:

-
    “Adding CSS definitions needed to create a lightbox
    overlay when focus is on the offers iframe”
-
    “Fixed bug with session expiring after browser restart on
    IE7”
-
    “Updated the logo with the new colors provided”
-
    “Adding interfaces for the new blog feature

    The interfaces are still quite lightweight, but should be
    refreshed in the next days”
-
If using an issue tracker (Jira, Trac,
Bugzilla, Redmine, etc.), write the
 issue ID in the commit message:

   «Fixed iframe width causing
  scrollbars to appear when not
      needed as of PRJ-123»
Optimal process
Update working copy


                         Build (test first)


If there’s errors, fix them first! (do not work on broken projects)


                             Develop


                          Test changes


              Commit (with appropriate message)


                 Resolve conflicts immediately
Suggested Workflow
This is actually how
git-flow by nvie.com
handles development,
but SVN could also use
it!
Svn Basic Tutorial
Svn Basic Tutorial
Svn Basic Tutorial

Weitere ähnliche Inhalte

Was ist angesagt?

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
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Simplilearn
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control SystemKMS Technology
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticlePRIYATHAMDARISI
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash CourseNilay Binjola
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN TutorialenggHeads
 

Was ist angesagt? (20)

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
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Git basics
Git basicsGit basics
Git basics
 
Learning git
Learning gitLearning git
Learning git
 
Jenkins Tutorial.pdf
Jenkins Tutorial.pdfJenkins Tutorial.pdf
Jenkins Tutorial.pdf
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Git Pull Requests
Git Pull RequestsGit Pull Requests
Git Pull Requests
 
SVN Basics
SVN BasicsSVN Basics
SVN Basics
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN Tutorial
 

Andere mochten auch

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best PracticesAshraf Fouad
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to SubversionAtul Jha
 
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
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overviewpolarion
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn WorkshopBastian Feder
 
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
 
CS589 paper presentation - What is in unison? A formal specification and refe...
CS589 paper presentation - What is in unison? A formal specification and refe...CS589 paper presentation - What is in unison? A formal specification and refe...
CS589 paper presentation - What is in unison? A formal specification and refe...Sergii Shmarkatiuk
 
Getting your open source company to contribution
Getting your open source company to contributionGetting your open source company to contribution
Getting your open source company to contributionAsavin Wattanajantra
 
Sql server 2012 tutorials reporting services
Sql server 2012 tutorials   reporting servicesSql server 2012 tutorials   reporting services
Sql server 2012 tutorials reporting servicesSteve Xu
 
Nguyễn Vũ Hưng: Subversion best practices
Nguyễn Vũ Hưng: Subversion best practicesNguyễn Vũ Hưng: Subversion best practices
Nguyễn Vũ Hưng: Subversion best practicesVu Hung Nguyen
 

Andere mochten auch (20)

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to Subversion
 
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
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overview
 
Using svn
Using svnUsing svn
Using svn
 
05 - Merge Management
05 - Merge Management05 - Merge Management
05 - Merge Management
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practices
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 
Svn tutorial
Svn tutorialSvn tutorial
Svn tutorial
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
 
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
 
CS589 paper presentation - What is in unison? A formal specification and refe...
CS589 paper presentation - What is in unison? A formal specification and refe...CS589 paper presentation - What is in unison? A formal specification and refe...
CS589 paper presentation - What is in unison? A formal specification and refe...
 
Getting your open source company to contribution
Getting your open source company to contributionGetting your open source company to contribution
Getting your open source company to contribution
 
Tortoise svn 1.8.1-en
Tortoise svn 1.8.1-enTortoise svn 1.8.1-en
Tortoise svn 1.8.1-en
 
Sql server 2012 tutorials reporting services
Sql server 2012 tutorials   reporting servicesSql server 2012 tutorials   reporting services
Sql server 2012 tutorials reporting services
 
Nguyễn Vũ Hưng: Subversion best practices
Nguyễn Vũ Hưng: Subversion best practicesNguyễn Vũ Hưng: Subversion best practices
Nguyễn Vũ Hưng: Subversion best practices
 

Ähnlich wie Svn Basic Tutorial

How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLabPablo Arriazu
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld PresentationDan Hinojosa
 
Feature Based Web Development with Bazaar
Feature Based Web Development with BazaarFeature Based Web Development with Bazaar
Feature Based Web Development with Bazaaryogomozilla
 
Alm tce parallel development
Alm tce parallel developmentAlm tce parallel development
Alm tce parallel developmentshalom938
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Controlceardach
 
Maven, Archiva, Subversion and Team City
Maven, Archiva, Subversion and Team CityMaven, Archiva, Subversion and Team City
Maven, Archiva, Subversion and Team CityBoy Tech
 
Introduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingIntroduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingPhilip Johnson
 
Totalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By GopiTotalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By Gopigopinathkarangula
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...Simplilearn
 
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
 
Develop FOSS project using Google Code Hosting
Develop FOSS project using Google Code HostingDevelop FOSS project using Google Code Hosting
Develop FOSS project using Google Code HostingNarendra Sisodiya
 

Ähnlich wie Svn Basic Tutorial (20)

How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
 
Subversion
SubversionSubversion
Subversion
 
Subversion
SubversionSubversion
Subversion
 
SVN Information
SVN Information  SVN Information
SVN Information
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
Feature Based Web Development with Bazaar
Feature Based Web Development with BazaarFeature Based Web Development with Bazaar
Feature Based Web Development with Bazaar
 
Alm tce parallel development
Alm tce parallel developmentAlm tce parallel development
Alm tce parallel development
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Control
 
Maven, Archiva, Subversion and Team City
Maven, Archiva, Subversion and Team CityMaven, Archiva, Subversion and Team City
Maven, Archiva, Subversion and Team City
 
Introduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingIntroduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project Hosting
 
Totalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By GopiTotalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By Gopi
 
Agile Software Development & Tools
Agile Software Development & ToolsAgile Software Development & Tools
Agile Software Development & Tools
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
Subversion
SubversionSubversion
Subversion
 
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
 
Develop FOSS project using Google Code Hosting
Develop FOSS project using Google Code HostingDevelop FOSS project using Google Code Hosting
Develop FOSS project using Google Code Hosting
 
subversion.ppt
subversion.pptsubversion.ppt
subversion.ppt
 
Jenkins
JenkinsJenkins
Jenkins
 

Kürzlich hochgeladen

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 MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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 organizationRadu Cotescu
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Kürzlich hochgeladen (20)

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

Svn Basic Tutorial

  • 1. SVN BASIC TUTORIAL Formatvorlage des Untertitelmasters Avoiding headaches ™ durch Klicken bearbeiten
  • 2. Direct deploy Developer 1 Staging Live Developer 2 Staging Live Designer 1 Staging Live Designer 2 Staging Live
  • 3. Removal of direct deploy Developer 1 Staging Live Developer 2 Staging Live Designer 1 Staging Live Designer 2 Staging Live
  • 4. Why not to directly deploy • Can’t check the status of the environment • Race conditions (DEV1 and DEV2 work on a same file => collisions) • Can’t easily update the environment (full replace of the entire working copy needed)
  • 5. SVN • Subversion (SVN) is a SCM (Software Configuration Management) implementation • It allows to track changes in files and directories • It allows concurrent development on the same files • It is centralized (one server)
  • 6. SVN Interaction Designer 2 Designer 1 Staging Server Developer 2 Issue Tracker Developer 1 SVN Server Production Server
  • 7. SVN development cycle Get last project status from SVN server Send work to SVN server Develop/Design Test
  • 8. SVN development (in SVN terms) svn update svn commit edit files Test
  • 9. How it works Will make some examples with TortoiseSVN and the command line to explain SVN
  • 14. Fetching an existing project The «.svn» directory is used by subversion to keep track of changes in the current directory tree. Do not change it, copy it somewhere else or delete it!
  • 16. Adding some files to the project
  • 17. Adding some files to the project
  • 18. Adding some files to the project
  • 19. Adding some files to the project
  • 20. Adding some files to the project
  • 24. Deploy with SVN When having SSH access to a server, deploying and updating becomes as easy as: $ ssh user@server.com $ cd path/to/project $ svn update (Or "svn co" if the project is not yet deployed)
  • 25. Merging and conflicts In the following schema, two developers try to commit changes to a same file: echo ‘hello to’; Developer 1 echo $username; echo ‘hello world ’; Developer 2 echo $_GET[‘username’]; RED = changed by developer
  • 26. How merging works When Developer 2 tries to commit, SVN will tell him that his copy is outdated, he will have to update it
  • 28. How merging works Merging won’t cause any changes on the server, you will first get all the changes locally, so that you can review them. Here’s the result of this merge case: We can then $ svn commit -m "Merged changes of marco’s commit"
  • 29. Merging workflow svn commit Developer verifies merge Can’t commit (outdated working copy) svn tries to merge svn update
  • 30. What if SVN can’t merge? svn commit SVN couldn’t merge Can’t commit (outdated working copy) ???????? svn tries to merge svn update
  • 31. SVN Conflicts SVN conflicts happen when two developers act on a same file in the same line: echo ‘hello everybody’; Developer 1 echo $_GET[‘username’]; echo ‘goodbye everybody’; Developer 2 echo $_GET[‘username’]; RED = changed by developer
  • 33. SVN Conflicts • index.php is a merged view of the conflict: • • index.php.r8 is the version before the update • index.php.r9 is the version as in SVN server • index.php.mine is the version you had in your directory before committing
  • 34. SVN Conflicts We can edit the files until all conflicts are solved, then tell SVN it should accept our new working copy:
  • 35. SVN Conflicts svn commit Mark conflicts as resolved Can’t commit (outdated working copy) Manually edit conflicts svn update SVN couldn’t merge svn tries to merge
  • 37. SVN branching Main project Next major version update The main project and it’s features Bugfix for a known bug Keeps track of changes to be merged into the next major release of the software New feature that has to be added Work in progress to fix a known bug Alternate version to show to the customer A new feature that requires some work without being influenced b A slightly different version of the site that t
  • 38. This is actually how git-flow by nvie.com handles development, but SVN could also use it!
  • 39. What is a branch? In SVN terms, a branch is just a copy of a current tree. Let’s create a branch to develop an alternate layout for the site: svn copy -m “creating green site dev branch” svn://path/to/repo/trunk svn://path/to/repo/branches/wide-layout (in TortoiseSVN it is under “branch/tag” in context menu)
  • 40. Switching working copy Given that you checked out: svn://project/path/trunk You can now switch to a branch by doing svn switch svn://project/path/branches/red and you will be working on that copy
  • 41. Merging branches Once completed developing on a branch, you may want to merge changes back:
  • 42. Merging branches Like normal conflict merging!
  • 43. First you switch to the branch you want changes to be merged to: $ svn switch svn://path/to/target/branch
  • 44. Then you merge a set of revision from the branch you developed on (here 25 to latest): $ svn merge -r25:HEAD svn://path/to/merged/branch
  • 45. Then SVN will merge any conflicts or set conflicted state and allow you to check what happened. After fixing conflicts: $ svn ci -m “merging changes from new-layout branch”
  • 46. Tags Tags are markers used for deployment, mainly for major release versions:
  • 47. Tags Tags are copies, exactly like branches: $ svn copy -m “tagging version 1.1 of the project” svn://path/to/project svn://path/to/tags/1.1 Except that you NEVER commit on tags!
  • 48. svn:externals Externals are “links” to other repositories: $ svn propset svn:externals “css/common svn://company/common/css/files” ./ Externals are not part of the repository, they are just fetched with the repository (useful for deploying applications!)
  • 50. Update your projects before working
  • 51. Do not commit broken code/functionality! (Test before committing if possible!)
  • 52. Commit as soon as a piece of the functionality is completed
  • 53. Branch life should not be too long Long living branches increase merge conflicts! This forces you to keep small units of work
  • 54. Every commit should have a purpose. Commits with no purpose to be avoided! If possible, avoid multiple commits on separate files being part of one functionality
  • 55. Never commit generated code/data! Generated code can produce dozens of useless commits, conflicts and generally, headaches!
  • 56. EVERY COMMIT MUST HAVE DESCRIPTION
  • 57. Examples of BAD commit messages: - “Fixed bug” - “Updated” - “Saved work” - “Updating” - “Merging changes” - “Saving work of 10/3/2010”
  • 58. Examples of GOOD commit messages: - “Adding CSS definitions needed to create a lightbox overlay when focus is on the offers iframe” - “Fixed bug with session expiring after browser restart on IE7” - “Updated the logo with the new colors provided” - “Adding interfaces for the new blog feature The interfaces are still quite lightweight, but should be refreshed in the next days” -
  • 59. If using an issue tracker (Jira, Trac, Bugzilla, Redmine, etc.), write the issue ID in the commit message: «Fixed iframe width causing scrollbars to appear when not needed as of PRJ-123»
  • 61. Update working copy Build (test first) If there’s errors, fix them first! (do not work on broken projects) Develop Test changes Commit (with appropriate message) Resolve conflicts immediately
  • 63. This is actually how git-flow by nvie.com handles development, but SVN could also use it!

Hinweis der Redaktion

  1. 28.03.2012
  2. 28.03.2012
  3. 28.03.2012
  4. 28.03.2012
  5. 28.03.2012
  6. 28.03.2012
  7. 28.03.2012
  8. 28.03.2012
  9. 28.03.2012
  10. 28.03.2012
  11. 28.03.2012
  12. 28.03.2012
  13. 28.03.2012
  14. 28.03.2012
  15. 28.03.2012
  16. 28.03.2012
  17. 28.03.2012
  18. 28.03.2012
  19. 28.03.2012
  20. 28.03.2012
  21. 28.03.2012
  22. 28.03.2012
  23. 28.03.2012
  24. 28.03.2012
  25. 28.03.2012
  26. 28.03.2012
  27. 28.03.2012
  28. 28.03.2012
  29. 28.03.2012
  30. 28.03.2012
  31. 28.03.2012
  32. 28.03.2012
  33. 28.03.2012
  34. 28.03.2012
  35. 28.03.2012
  36. 28.03.2012
  37. 28.03.2012
  38. 28.03.2012
  39. 28.03.2012
  40. 28.03.2012
  41. 28.03.2012
  42. 28.03.2012
  43. 28.03.2012
  44. 28.03.2012
  45. 28.03.2012
  46. 28.03.2012
  47. 28.03.2012
  48. 28.03.2012
  49. 28.03.2012
  50. 28.03.2012
  51. 28.03.2012
  52. 28.03.2012
  53. 28.03.2012
  54. 28.03.2012
  55. 28.03.2012