SlideShare a Scribd company logo
A day with Subversion (SVN)

            Sebastian Heimann

Institut f¨r Geophysik, Arbeitsgruppe Seismologie
          u


             February 15, 2007
Outline




    1. Concepts (by example)
    2. Vocabulary
    3. Benefits
    4. Further reading
The initial work


   Let’s assume we have just made a quick and dirty hack, which we
   now want to put under version contol for further development:

   > ls /my/hack
Create an empty repository


   > svnadmin create --fs-type fsfs /my/repos



                                        Repository
The initial import

   > svn import /my/hack file:///my/repos/hack/trunk 
              -m ’Initial import’



                                        Repository




                                   1
Checkout a working copy of hack


   > svn checkout file:///my/repos/hack/trunk /work/hack



                                        Repository
         Working copy



                                   1
Add a new feature to hack

   > cd /work/hack ; vi hack



                                   Repository
         Working copy



                               1
Commit your changes to the repository

   > svn commit



                                            Repository
         Working copy

                                        2




                                        1
More than one person can now work on hack



                          Repository


  Fu’s working copy   2                Fara’s working copy




                      1
Both implement their improvements



                          Repository


  Fu’s working copy   2                Fara’s working copy




                      1
Fu commits his changes to the repository



                        Repository
  > svn commit
                         3


                                       Fara’s working copy
   Fu’s working copy
                         2




                         1
Fara commits her changes to the repository

                        Repository

                         4



                                       > svn commit
   Fu’s working copy
                         3

                                       Fara’s working copy


                         2




                         1
To get each others changes

                        Repository

                        4



  > svn update                       > svn update

                        3

  Fu’s working copy                  Fara’s working copy


                        2




                        1
Fu and Fara can go back to any previous revision

                        Repository

                         4



  > svn update -r 1                     > svn update -r 3

                         3

   Fu’s working copy                    Fara’s working copy


                         2




                         1
Internally the repository will only store differences...

                           Repository

                           4




                           3




                           2




                           1
...but it pretends to make a new copy on every commit.

                        Repository

                         4




                         3




                         2




                         1
Sometimes it may be useful to branch the project...




   > svn cp -r 2 file:///my/repos/hack/trunk 
                 file:///my/repos/hack/branches/mad
...this creates a copy directly in the repository.


                       4




                       3




           .../trunk                         .../branches/mad
                       2         5




                       1
Check out a working copy of the branch




   > svn checkout file:///my/repos/hack/branches/mad 
                  /work/mad-hack
You can now safely experiment with mad-hack, while
maintaining a stable version of hack in the trunk.


                              4


 > cd /work/mad-hack

 > # edit it                  3        6




                              2        5




                              1

 > svn commit
Tagging: You can also use the branching mechanism to
mark a specific revisions as somehow special.




   > svn cp -r 2 file:///my/repos/hack/trunk 
                 file:///my/repos/hack/tags/stable-v1
Tagged stable version 1 of hack


                      4




                      3




          .../trunk               .../tags/stable-v1
                      2       5




                      1
Vocabulary




      repository
      revision
      working copy
      to check out
      to commit
      to update
Vocabulary




      to branch
      to merge
      to tag
Conventions




      hack/trunk
      hack/branches/mad
      hack/tags/stable-v1
Benefits




      Unlimited undo!
      Collaborate with others!
      Enforces structured development
      Makes you document what you are doing
      Automatic changelog!
      Helps you organize your mess in $HOME
Further reading


   Tutorial
       http://artis.imag.fr/~Xavier.Decoret/resources/svn/



   Documentation (A good intro is in Chapter 2)
       http://svnbook.red-bean.com/nightly/en/


   Online help
       > svn help
       > svn [command] help

More Related Content

PPT
3.1.c apend scripting, crond, atd
KEY
Deploying and maintaining your software with RPM/APT
PPTX
OS/161 Overview
PPTX
A brief history of system calls
PPT
Apache solr configuration with drupal 7
PPTX
Docker - A Ruby Introduction
ODP
Fabric Fast & Furious edition
PPTX
Project 2 - how to compile os161?
3.1.c apend scripting, crond, atd
Deploying and maintaining your software with RPM/APT
OS/161 Overview
A brief history of system calls
Apache solr configuration with drupal 7
Docker - A Ruby Introduction
Fabric Fast & Furious edition
Project 2 - how to compile os161?

What's hot (20)

PDF
Linux con europe_2014_f
PDF
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
DOCX
Ansible ex407 and EX 294
PPT
Docker 101, Alexander Ryabtsev
PDF
Make container without_docker_6-overlay-network_1
PDF
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
PDF
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
PPTX
How To Add System Call In Ubuntu OS
PPTX
PDF
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
PDF
Make container without_docker_7
DOCX
Samba 4 - debian instalacao
PPTX
Docker advance1
PDF
Kdump and the kernel crash dump analysis
ODP
inotify
PDF
Kernel_Crash_Dump_Analysis
ODP
Releasing and deploying python tools
PPT
Cache profiling on ARM Linux
PDF
Kernel Recipes 2017: Using Linux perf at Netflix
PDF
Tonehammer Requiem Professional [KONTAKT] .rar
Linux con europe_2014_f
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
Ansible ex407 and EX 294
Docker 101, Alexander Ryabtsev
Make container without_docker_6-overlay-network_1
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
How To Add System Call In Ubuntu OS
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
Make container without_docker_7
Samba 4 - debian instalacao
Docker advance1
Kdump and the kernel crash dump analysis
inotify
Kernel_Crash_Dump_Analysis
Releasing and deploying python tools
Cache profiling on ARM Linux
Kernel Recipes 2017: Using Linux perf at Netflix
Tonehammer Requiem Professional [KONTAKT] .rar
Ad

Viewers also liked (8)

PDF
open source intro
PDF
പഞ്ചായത്തു് കമ്പ്യൂട്ടര്‍വല്ക്കരണവും ഭരണഭാഷയും - ചില ചിന്തകള്‍
PDF
Bajji An Intro
PDF
OpenOffice-SpreadSheet
PDF
Radio An Intro
PDF
Cloud Compt
PDF
PHP an intro -1
PDF
Basic Commands 1 By Thanigai
open source intro
പഞ്ചായത്തു് കമ്പ്യൂട്ടര്‍വല്ക്കരണവും ഭരണഭാഷയും - ചില ചിന്തകള്‍
Bajji An Intro
OpenOffice-SpreadSheet
Radio An Intro
Cloud Compt
PHP an intro -1
Basic Commands 1 By Thanigai
Ad

Similar to Sub Version Intro (20)

ODP
An introduction to SVN
KEY
Version control with subversion
PDF
Svn workflow
PDF
Subversion: A Getting Started Presentation
PPTX
Random House
PPTX
Understanding GIT and Version Control
PDF
Version Control with SVN
PPTX
Subversion last minute survival crash course
PDF
PPTX
Git basic stanley hsiao 2010_12_15
ODP
Burlington, VT PHP Users Group Subversion Presentation
KEY
Introduce to SVN
PPT
Totalsvn Usage And Administration By Gopi
ODP
Svn Basic Tutorial
KEY
Introduction To Git
PDF
SVN essentials
PDF
Understanding Distributed Source Control
PPTX
Subversion
ODP
Practical SVN for PHP Developers
An introduction to SVN
Version control with subversion
Svn workflow
Subversion: A Getting Started Presentation
Random House
Understanding GIT and Version Control
Version Control with SVN
Subversion last minute survival crash course
Git basic stanley hsiao 2010_12_15
Burlington, VT PHP Users Group Subversion Presentation
Introduce to SVN
Totalsvn Usage And Administration By Gopi
Svn Basic Tutorial
Introduction To Git
SVN essentials
Understanding Distributed Source Control
Subversion
Practical SVN for PHP Developers

More from Kanchilug (16)

PDF
Perl intro
PDF
Ltsp talk
PDF
Kanchilug Boot camp
PDF
Perl Basics
PDF
Gnu/Linux calendar 2010 final
PDF
Gnu/Linux Calendar 2010 V -1.0
PDF
ubuntu 9.10 release party @ kanchilug
PDF
Python quick guide1
PDF
Linux Commands - 3
PDF
SFD '09 Article in Tamil
PDF
More Depth Commands In Linux - By Vishnu
PDF
How to Install Ubuntu as Dual
PDF
Kanchi Lug Pam-let
PDF
An Intro To Television
PDF
How To Use Open Office WordProcessor
PDF
How To Use Open Office. Impress
Perl intro
Ltsp talk
Kanchilug Boot camp
Perl Basics
Gnu/Linux calendar 2010 final
Gnu/Linux Calendar 2010 V -1.0
ubuntu 9.10 release party @ kanchilug
Python quick guide1
Linux Commands - 3
SFD '09 Article in Tamil
More Depth Commands In Linux - By Vishnu
How to Install Ubuntu as Dual
Kanchi Lug Pam-let
An Intro To Television
How To Use Open Office WordProcessor
How To Use Open Office. Impress

Recently uploaded (20)

PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
master seminar digital applications in india
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
Cell Structure & Organelles in detailed.
PPTX
Lesson notes of climatology university.
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
O5-L3 Freight Transport Ops (International) V1.pdf
Supply Chain Operations Speaking Notes -ICLT Program
TR - Agricultural Crops Production NC III.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
VCE English Exam - Section C Student Revision Booklet
Final Presentation General Medicine 03-08-2024.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
GDM (1) (1).pptx small presentation for students
master seminar digital applications in india
FourierSeries-QuestionsWithAnswers(Part-A).pdf
01-Introduction-to-Information-Management.pdf
Cell Types and Its function , kingdom of life
Cell Structure & Organelles in detailed.
Lesson notes of climatology university.
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Sports Quiz easy sports quiz sports quiz
2.FourierTransform-ShortQuestionswithAnswers.pdf
Microbial disease of the cardiovascular and lymphatic systems

Sub Version Intro

  • 1. A day with Subversion (SVN) Sebastian Heimann Institut f¨r Geophysik, Arbeitsgruppe Seismologie u February 15, 2007
  • 2. Outline 1. Concepts (by example) 2. Vocabulary 3. Benefits 4. Further reading
  • 3. The initial work Let’s assume we have just made a quick and dirty hack, which we now want to put under version contol for further development: > ls /my/hack
  • 4. Create an empty repository > svnadmin create --fs-type fsfs /my/repos Repository
  • 5. The initial import > svn import /my/hack file:///my/repos/hack/trunk -m ’Initial import’ Repository 1
  • 6. Checkout a working copy of hack > svn checkout file:///my/repos/hack/trunk /work/hack Repository Working copy 1
  • 7. Add a new feature to hack > cd /work/hack ; vi hack Repository Working copy 1
  • 8. Commit your changes to the repository > svn commit Repository Working copy 2 1
  • 9. More than one person can now work on hack Repository Fu’s working copy 2 Fara’s working copy 1
  • 10. Both implement their improvements Repository Fu’s working copy 2 Fara’s working copy 1
  • 11. Fu commits his changes to the repository Repository > svn commit 3 Fara’s working copy Fu’s working copy 2 1
  • 12. Fara commits her changes to the repository Repository 4 > svn commit Fu’s working copy 3 Fara’s working copy 2 1
  • 13. To get each others changes Repository 4 > svn update > svn update 3 Fu’s working copy Fara’s working copy 2 1
  • 14. Fu and Fara can go back to any previous revision Repository 4 > svn update -r 1 > svn update -r 3 3 Fu’s working copy Fara’s working copy 2 1
  • 15. Internally the repository will only store differences... Repository 4 3 2 1
  • 16. ...but it pretends to make a new copy on every commit. Repository 4 3 2 1
  • 17. Sometimes it may be useful to branch the project... > svn cp -r 2 file:///my/repos/hack/trunk file:///my/repos/hack/branches/mad
  • 18. ...this creates a copy directly in the repository. 4 3 .../trunk .../branches/mad 2 5 1
  • 19. Check out a working copy of the branch > svn checkout file:///my/repos/hack/branches/mad /work/mad-hack
  • 20. You can now safely experiment with mad-hack, while maintaining a stable version of hack in the trunk. 4 > cd /work/mad-hack > # edit it 3 6 2 5 1 > svn commit
  • 21. Tagging: You can also use the branching mechanism to mark a specific revisions as somehow special. > svn cp -r 2 file:///my/repos/hack/trunk file:///my/repos/hack/tags/stable-v1
  • 22. Tagged stable version 1 of hack 4 3 .../trunk .../tags/stable-v1 2 5 1
  • 23. Vocabulary repository revision working copy to check out to commit to update
  • 24. Vocabulary to branch to merge to tag
  • 25. Conventions hack/trunk hack/branches/mad hack/tags/stable-v1
  • 26. Benefits Unlimited undo! Collaborate with others! Enforces structured development Makes you document what you are doing Automatic changelog! Helps you organize your mess in $HOME
  • 27. Further reading Tutorial http://artis.imag.fr/~Xavier.Decoret/resources/svn/ Documentation (A good intro is in Chapter 2) http://svnbook.red-bean.com/nightly/en/ Online help > svn help > svn [command] help