SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
Buland Singh
 

Tendances (20)

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

En vedette (8)

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

Similaire à Sub Version Intro

Subversion
SubversionSubversion
Subversion
rchakra
 
Symfony Live 09 Symfony 2
Symfony Live 09 Symfony 2Symfony Live 09 Symfony 2
Symfony Live 09 Symfony 2
narkoza
 

Similaire à Sub Version Intro (20)

Subversion last minute survival crash course
Subversion  last minute survival crash courseSubversion  last minute survival crash course
Subversion last minute survival crash course
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Tsvn17
Tsvn17Tsvn17
Tsvn17
 
Difference between team foundation server and subversion
Difference between team foundation server and subversionDifference between team foundation server and subversion
Difference between team foundation server and subversion
 
SVN Information
SVN Information  SVN Information
SVN Information
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
 
Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell
 
Welcome to the Symfony2 World - FOSDEM 2013
 Welcome to the Symfony2 World - FOSDEM 2013 Welcome to the Symfony2 World - FOSDEM 2013
Welcome to the Symfony2 World - FOSDEM 2013
 
Git your life for fun & profit
Git your life for fun & profitGit your life for fun & profit
Git your life for fun & profit
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
Subversion User Guide
Subversion User GuideSubversion User Guide
Subversion User Guide
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Svn workflow
Svn workflowSvn workflow
Svn workflow
 
Subversion
SubversionSubversion
Subversion
 
Symfony Live 09 Symfony 2
Symfony Live 09 Symfony 2Symfony Live 09 Symfony 2
Symfony Live 09 Symfony 2
 
Subversion
SubversionSubversion
Subversion
 
Git your life for fun & profit
Git your life for fun & profitGit your life for fun & profit
Git your life for fun & profit
 
bash_1_2021-command line introduction.pdf
bash_1_2021-command line introduction.pdfbash_1_2021-command line introduction.pdf
bash_1_2021-command line introduction.pdf
 

Plus de Kanchilug (16)

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

Dernier

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Dernier (20)

psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 

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