SlideShare ist ein Scribd-Unternehmen logo
1 von 28
SUBVERSION
 a.k.a SVN

              Under Linux



             By O. Teytaud
SUBVERSION
                  a.k.a SVN

  Earliest tools for version       Under Linux
control systems: the mid-70s.
                                  By O. Teytaud
  Stable tool: 1986, CVS.

 Now: SVN widely used for
  source code or text files.

Recent tools: git, mercurial...
SUBVERSION
              a.k.a SVN


   I will present the       Under Linux


“command line” version.
                           By O. Teytaud

No window, no mouse.

You can find graphical
interfaces as well; e.g.
     TortoiseSVN.
Various reasons for which
                    I use command line

              I know most of you (almost) never use
                        the command line.
                I use command line all the day long.

                    Reason 1: I am an old guy.
When I learnt computer science, there was no window on a computer,
   no mouse, and everything was done through command line.

        Reason 2: I work on High-Performance Computing.
       Many things on clusters are done without any window.

 Reason 3: For many things, you would be indeed faster if you
       were working in command line. Give it a try :-)
               In particular, for administration.
Why version control systems ?

                 Meeting 1: 3 persons A, B, C, decide
                    to work together on a project:
- A creates france.h and france.cpp;
- B creates taiwan.h and taiwan.cpp;
- C creates US.h and US.cpp.

        Meeting 2: They put all files in the same directory.
        It works.
Then all keep a copy of France + Taiwan + US;
then, each of them modifies some files.

A modifies france.cpp, and a little bit US.cpp.
B modifies taiwan.cpp, and a little bit US.cpp.
C modifies US.cpp.

        Meeting 3: They (try to) put all files in the same directory.
        Which US.cpp should they use ?
        ==> nothing works. They spend hours debugging.
Version control systems
                    is here for that !

                 Meeting 1: 3 persons A, B, C, decide
                    to work together on a project:
- A creates france.h and france.cpp;
- B creates taiwan.h and taiwan.cpp;
- C creates US.h and US.cpp.

        Meeting 2: They put all files in the same SVN-repository.
        It works.
Each of them modifies some files.

A modifies france.cpp, and a little bit US.cpp.
B modifies taiwan.cpp, and a little bit US.cpp.
C modifies US.cpp.       THEY ALL SEE MODIFICATIONS BY OTHERS !

       Meeting 3: They are very happy!
       Everything works.
Nowadays, no big
        Programming project
               without
   version control systems (VCS).

  CVS = good old system for VCS.
 SVN = CVS + some improvements.
     (tortoiseSVN for Windows)
GIT, MERCURIAL = for some specific
more complicated cases (many distinct
              versions).
       I recommend SVN as a first choice.
Nowadays, no big project in
      computer science without
    version control systems (VCS).

  CVS = good old system for VCS.
 SVN = CVS + some improvements.
GIT, MERCURIAL = for some specific
more complicated cases (many distinct
             versions).
        I recommend SVN as a first choice.



Also termed “source code management” systems.
Step 1: install SUBVERSION on your system.



                   No problem:
  Ubuntu Linux: sudo apt-get install subversion.
      Windows: use google, find subversion
        for Windows, download/install it.


         At many points when you use it,
         SVN will ask for a log message.

You just have, then, to explain what you are doing;
         this will be visible by other users.
Step 2: choosing where is the repository
  Here, John is the admin of the SVN repository.

   e.g. John will create the repository in his own directory.

cd /home/john
svnadmin create svn

   This is the svn root.
   Run by one user only ==> don't have one SVNROOT per user.

John will work with Paul and I-Chen. He creates a directory for this:

svn mkdir file:///home/john/svn/projectJPIC

He can create a “brother” directory for works with André and Olivier:

svn mkdir file:///home/john/svn/projectJAO

and so on – no problem.
Step 3: Take time for understanding :-)




John has his repository ready on his machine.
      But Paul and I-Chen do not work
           on the same machine.
                   So what ?
We will have to communicate through internet.
 The idea is to make the process automatic.
Step 4: putting the current files
                (if any) in the repository




Forget this step if you have no files for the moment.

cd /home/john/work/projectJPIC
                        ### assuming that the project
               ### is in /home/john/work/projectJPIC
svn import file:///home/john/svn/projectJPIC

          ==> ok, the files are installed!
Step 5: create working copies!

           You should never work in
          /home/john/svn/projectJPIC
              This is for SVN only.
       You should work on working copies.

  This is true for Paul, I-Chen, and also for John!

Paul, I-Chen and John all go to the directory
in which they want to work, and do:
svn checkout file:///home/john/svn/projectJPIC

==> this creates a working copy.
==> you can modify it as much as you want.
Step 6: understanding !




   John's
                                              Paul's
working copy.                              working copy.



                    Paul's SVN
                    repository

                                          Never modify Paul's
                                          SVN repository
                                          directly !

                    I-Chen's              SVN would become
                  working copy.           crazy.
Step 7: sending your modifications.

                   I edit France.cpp.
             I like my changes, I want to
                  make them available
                      for B and C.

      When you want to send your version to the
                    SVN repository:
                svn commit France.cpp
                         or just
                      svn commit
(will send all your modifications, not just France.cpp)
      Or:
      svn commit -m “major bugfix in France.cpp”
                to choose the message
Step 8: receiving others' modifications

    svn update taiwan.cpp
 ==> will just update Taiwan.cpp
            svn update
    ==> will update everything.

SVN will not accept to commit a file
       if it's not up-to-date
 ==> always “svn update” before
            “svn commit”.
Step 9: adding new files


      svn add belgium.cpp
  ==> I tell SVN that the new file
   “Belgium.cpp” is now under
          Version control
     svn commit belgium.cpp
==> will send belgium.cpp to others.
Step 10: get information!

               svn info
==> will tell you various global info.

        svn log france.cpp
       ==> will tell you what
      happened to france.cpp

     svn blame france.cpp
  ==> will tell you, for each line,
      where it comes from.
Step 11a: conflicts




     If I modify line 10,
 from “x++;” to “++x;”
     whereas you write:
   from “x++;” to x=x+1;”.

then SVN will have a trouble.
Step 11b: conflicts




Such a trouble is termed a conflict:
      svn update taiwan.cpp
      replies “C taiwan.cpp”
 which means “There is a conflict
  in taiwan.cpp, please solve.”

         ==> edit the file.
Step 11c: conflicts


            ==> edit the file.

  <<<<<<< .mine
  x=x+1;
  =======
  ++x;
  >>>>>>> .r6

 ==> write what you really want,
    and remove “<<<”, “===”,”>>>”
==> svn resolved taiwan.cpp
Step 12: many others!




   svn revert ==> removes your modifications

svn diff ==> checks differences between versions.

           svn rm ==> removes a file
Step 13: without shared disk space ?




            We have used “file:///”
which means that you have access to a shared
  disk (Paul, I-Chen and John write/read the
                  same disk).

       This is not necessarily the case.

             Then replace “file:///”
               by “svn+ssh://”
            and install “svnserve”.
Summary:

- All big projects now under version
    management systems.

- The administration of a SVN can be a bit tricky,
   but as a user it's quite easy; in everyday life, you
   will use essentially:
      - svn update
      - svn commit
      - ...and sometimes (unfortunately) svn resolved

- When no common disk space, you need “ssh”; a bit
   more tricky, as an admin, but not that much.
Home work:

1) Make groups (~3/4 persons, A B C and D).
2) Install the SVN together; set it up with
     - one file “readme”
     - one directory “plane”
3) A, B, C and D all put one image in the “plane”
     Directory, described in the readme
4) Collect the following info:
    svn info
    svn log
    svn status
    svn blame readme
Decentralized versions ?

   SVN style                         GIT style:
                                     you get the patches
WC1                   WC2            you want from who
                                     you want
            SVN
         repository            WC1                WC2


         WC3

More possibilities with Git;           WC3
 but far less convenient
I hate administration.
      How can I use “git” or “svn” or cvs” ?
                                                 Alioth
      BerliOS
                                                 Assembla
      GitHub
                                                 BerliOS
      Gitorious
                                                 Betavine
                                                                  Svn
      JavaForge (with pull requests to control
      source code contribution)                  Freepository
                                                 Google Code
Git   SourceForge
      GNU Savannah                               SourceForge
      Google Code
      Bitbucket                          Thanks Wikipedia for
                                               providing a
                                         list of free websites.
Multimedia
                Browser   Java IDE                Java DK
                                      player


Mercurial users: Mozilla, NetBeans, Xine, Xen, OpenJDK,
OpenOffice.org, OpenSolaris, wmii, MoinMoin, Linux-HA, Python
==> many sources consider Mercurial as better than git (same
syntax, better doc)

SVN users: ASF, SourceForge, FreeBSD, Google Code, KDE, GCC,
Ruby, Mono, PuTTY, Zope, Xiph, GnuPG, CUPS, Wireshark, TWiki,
Django, available on CodePlex, and many organizations worldwide
(for simple standard use, SVN is probably the best choice)

Git users: Linux kernel, GNOME, Perl 5, X.Org, Cairo,
Qt Development Frameworks, Samba, OpenEmbedded,
Ruby on Rails, Wine, Fluxbox, Openbox, Compiz Fusion,
XCB, ELinks, XMMS2, e2fsprogs, GNU Core Utilities,
DokuWiki (plenty of “geek-style” GNU/Linux stuff)
==> becomes a standard... but more tricky than SVN.

Weitere ähnliche Inhalte

Was ist angesagt?

Docker workshop
Docker workshopDocker workshop
Docker workshop
Evans Ye
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windows
tutorialsruby
 
Open Source Virtualization Hacks
Open Source Virtualization HacksOpen Source Virtualization Hacks
Open Source Virtualization Hacks
Niel Bornstein
 

Was ist angesagt? (20)

Docker & ci
Docker & ciDocker & ci
Docker & ci
 
TYPO3 CMS deployment with Jenkins CI
TYPO3 CMS deployment with Jenkins CITYPO3 CMS deployment with Jenkins CI
TYPO3 CMS deployment with Jenkins CI
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)
 
Corwin on Containers
Corwin on ContainersCorwin on Containers
Corwin on Containers
 
Cvs
CvsCvs
Cvs
 
Apache Flink Crash Course by Slim Baltagi and Srini Palthepu
Apache Flink Crash Course by Slim Baltagi and Srini PalthepuApache Flink Crash Course by Slim Baltagi and Srini Palthepu
Apache Flink Crash Course by Slim Baltagi and Srini Palthepu
 
The Docker ecosystem and the future of application deployment
The Docker ecosystem and the future of application deploymentThe Docker ecosystem and the future of application deployment
The Docker ecosystem and the future of application deployment
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with Subversion
 
Subversion workshop
Subversion workshopSubversion workshop
Subversion workshop
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Deploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using SurfDeploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using Surf
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windows
 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in Libraries
 
Power Of Zero
Power Of ZeroPower Of Zero
Power Of Zero
 
Open P2P Design: Workshop @ Pixelversity, Helsinki (16/09/2011)
Open P2P Design: Workshop @ Pixelversity, Helsinki (16/09/2011)Open P2P Design: Workshop @ Pixelversity, Helsinki (16/09/2011)
Open P2P Design: Workshop @ Pixelversity, Helsinki (16/09/2011)
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
All of Your Network Monitoring is (probably) Wrong
All of Your Network Monitoring is (probably) WrongAll of Your Network Monitoring is (probably) Wrong
All of Your Network Monitoring is (probably) Wrong
 
Dev-Jam 2019 - Developing & Contributing to OpenNMS
Dev-Jam 2019 - Developing & Contributing to OpenNMSDev-Jam 2019 - Developing & Contributing to OpenNMS
Dev-Jam 2019 - Developing & Contributing to OpenNMS
 
Open Source Virtualization Hacks
Open Source Virtualization HacksOpen Source Virtualization Hacks
Open Source Virtualization Hacks
 

Ähnlich wie An introduction to SVN

Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP Developers
Lorna Mitchell
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenv
amenasse
 
Subversion
SubversionSubversion
Subversion
thebdot1
 
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
Philip Johnson
 
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxPart 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
karlhennesey
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous Integration
PASCAL Jean Marie
 

Ähnlich wie An introduction to SVN (20)

subversion.ppt
subversion.pptsubversion.ppt
subversion.ppt
 
Totalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By GopiTotalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By Gopi
 
Subversion Saves The Day
Subversion Saves The DaySubversion Saves The Day
Subversion Saves The Day
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Installing OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xInstalling OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.x
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!
 
Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP Developers
 
Version Management with CVS
Version Management with CVSVersion Management with CVS
Version Management with CVS
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN Tutorial
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenv
 
Docker
DockerDocker
Docker
 
SVN essentials
SVN essentialsSVN essentials
SVN essentials
 
J+s
J+sJ+s
J+s
 
Svn Basic Tutorial
Svn Basic TutorialSvn Basic Tutorial
Svn Basic Tutorial
 
Subversion
SubversionSubversion
Subversion
 
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
 
AntiVirus Evasion Reconstructed - Veil 3.0
AntiVirus Evasion Reconstructed - Veil 3.0AntiVirus Evasion Reconstructed - Veil 3.0
AntiVirus Evasion Reconstructed - Veil 3.0
 
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxPart 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous Integration
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
Safe Software
 

Kürzlich hochgeladen (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
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...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"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 ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

An introduction to SVN

  • 1. SUBVERSION a.k.a SVN Under Linux By O. Teytaud
  • 2. SUBVERSION a.k.a SVN Earliest tools for version Under Linux control systems: the mid-70s. By O. Teytaud Stable tool: 1986, CVS. Now: SVN widely used for source code or text files. Recent tools: git, mercurial...
  • 3. SUBVERSION a.k.a SVN I will present the Under Linux “command line” version. By O. Teytaud No window, no mouse. You can find graphical interfaces as well; e.g. TortoiseSVN.
  • 4. Various reasons for which I use command line I know most of you (almost) never use the command line. I use command line all the day long. Reason 1: I am an old guy. When I learnt computer science, there was no window on a computer, no mouse, and everything was done through command line. Reason 2: I work on High-Performance Computing. Many things on clusters are done without any window. Reason 3: For many things, you would be indeed faster if you were working in command line. Give it a try :-) In particular, for administration.
  • 5. Why version control systems ? Meeting 1: 3 persons A, B, C, decide to work together on a project: - A creates france.h and france.cpp; - B creates taiwan.h and taiwan.cpp; - C creates US.h and US.cpp. Meeting 2: They put all files in the same directory. It works. Then all keep a copy of France + Taiwan + US; then, each of them modifies some files. A modifies france.cpp, and a little bit US.cpp. B modifies taiwan.cpp, and a little bit US.cpp. C modifies US.cpp. Meeting 3: They (try to) put all files in the same directory. Which US.cpp should they use ? ==> nothing works. They spend hours debugging.
  • 6. Version control systems is here for that ! Meeting 1: 3 persons A, B, C, decide to work together on a project: - A creates france.h and france.cpp; - B creates taiwan.h and taiwan.cpp; - C creates US.h and US.cpp. Meeting 2: They put all files in the same SVN-repository. It works. Each of them modifies some files. A modifies france.cpp, and a little bit US.cpp. B modifies taiwan.cpp, and a little bit US.cpp. C modifies US.cpp. THEY ALL SEE MODIFICATIONS BY OTHERS ! Meeting 3: They are very happy! Everything works.
  • 7. Nowadays, no big Programming project without version control systems (VCS). CVS = good old system for VCS. SVN = CVS + some improvements. (tortoiseSVN for Windows) GIT, MERCURIAL = for some specific more complicated cases (many distinct versions). I recommend SVN as a first choice.
  • 8. Nowadays, no big project in computer science without version control systems (VCS). CVS = good old system for VCS. SVN = CVS + some improvements. GIT, MERCURIAL = for some specific more complicated cases (many distinct versions). I recommend SVN as a first choice. Also termed “source code management” systems.
  • 9. Step 1: install SUBVERSION on your system. No problem: Ubuntu Linux: sudo apt-get install subversion. Windows: use google, find subversion for Windows, download/install it. At many points when you use it, SVN will ask for a log message. You just have, then, to explain what you are doing; this will be visible by other users.
  • 10. Step 2: choosing where is the repository Here, John is the admin of the SVN repository. e.g. John will create the repository in his own directory. cd /home/john svnadmin create svn This is the svn root. Run by one user only ==> don't have one SVNROOT per user. John will work with Paul and I-Chen. He creates a directory for this: svn mkdir file:///home/john/svn/projectJPIC He can create a “brother” directory for works with André and Olivier: svn mkdir file:///home/john/svn/projectJAO and so on – no problem.
  • 11. Step 3: Take time for understanding :-) John has his repository ready on his machine. But Paul and I-Chen do not work on the same machine. So what ? We will have to communicate through internet. The idea is to make the process automatic.
  • 12. Step 4: putting the current files (if any) in the repository Forget this step if you have no files for the moment. cd /home/john/work/projectJPIC ### assuming that the project ### is in /home/john/work/projectJPIC svn import file:///home/john/svn/projectJPIC ==> ok, the files are installed!
  • 13. Step 5: create working copies! You should never work in /home/john/svn/projectJPIC This is for SVN only. You should work on working copies. This is true for Paul, I-Chen, and also for John! Paul, I-Chen and John all go to the directory in which they want to work, and do: svn checkout file:///home/john/svn/projectJPIC ==> this creates a working copy. ==> you can modify it as much as you want.
  • 14. Step 6: understanding ! John's Paul's working copy. working copy. Paul's SVN repository Never modify Paul's SVN repository directly ! I-Chen's SVN would become working copy. crazy.
  • 15. Step 7: sending your modifications. I edit France.cpp. I like my changes, I want to make them available for B and C. When you want to send your version to the SVN repository: svn commit France.cpp or just svn commit (will send all your modifications, not just France.cpp) Or: svn commit -m “major bugfix in France.cpp” to choose the message
  • 16. Step 8: receiving others' modifications svn update taiwan.cpp ==> will just update Taiwan.cpp svn update ==> will update everything. SVN will not accept to commit a file if it's not up-to-date ==> always “svn update” before “svn commit”.
  • 17. Step 9: adding new files svn add belgium.cpp ==> I tell SVN that the new file “Belgium.cpp” is now under Version control svn commit belgium.cpp ==> will send belgium.cpp to others.
  • 18. Step 10: get information! svn info ==> will tell you various global info. svn log france.cpp ==> will tell you what happened to france.cpp svn blame france.cpp ==> will tell you, for each line, where it comes from.
  • 19. Step 11a: conflicts If I modify line 10, from “x++;” to “++x;” whereas you write: from “x++;” to x=x+1;”. then SVN will have a trouble.
  • 20. Step 11b: conflicts Such a trouble is termed a conflict: svn update taiwan.cpp replies “C taiwan.cpp” which means “There is a conflict in taiwan.cpp, please solve.” ==> edit the file.
  • 21. Step 11c: conflicts ==> edit the file. <<<<<<< .mine x=x+1; ======= ++x; >>>>>>> .r6 ==> write what you really want, and remove “<<<”, “===”,”>>>” ==> svn resolved taiwan.cpp
  • 22. Step 12: many others! svn revert ==> removes your modifications svn diff ==> checks differences between versions. svn rm ==> removes a file
  • 23. Step 13: without shared disk space ? We have used “file:///” which means that you have access to a shared disk (Paul, I-Chen and John write/read the same disk). This is not necessarily the case. Then replace “file:///” by “svn+ssh://” and install “svnserve”.
  • 24. Summary: - All big projects now under version management systems. - The administration of a SVN can be a bit tricky, but as a user it's quite easy; in everyday life, you will use essentially: - svn update - svn commit - ...and sometimes (unfortunately) svn resolved - When no common disk space, you need “ssh”; a bit more tricky, as an admin, but not that much.
  • 25. Home work: 1) Make groups (~3/4 persons, A B C and D). 2) Install the SVN together; set it up with - one file “readme” - one directory “plane” 3) A, B, C and D all put one image in the “plane” Directory, described in the readme 4) Collect the following info: svn info svn log svn status svn blame readme
  • 26. Decentralized versions ? SVN style GIT style: you get the patches WC1 WC2 you want from who you want SVN repository WC1 WC2 WC3 More possibilities with Git; WC3 but far less convenient
  • 27. I hate administration. How can I use “git” or “svn” or cvs” ? Alioth BerliOS Assembla GitHub BerliOS Gitorious Betavine Svn JavaForge (with pull requests to control source code contribution) Freepository Google Code Git SourceForge GNU Savannah SourceForge Google Code Bitbucket Thanks Wikipedia for providing a list of free websites.
  • 28. Multimedia Browser Java IDE Java DK player Mercurial users: Mozilla, NetBeans, Xine, Xen, OpenJDK, OpenOffice.org, OpenSolaris, wmii, MoinMoin, Linux-HA, Python ==> many sources consider Mercurial as better than git (same syntax, better doc) SVN users: ASF, SourceForge, FreeBSD, Google Code, KDE, GCC, Ruby, Mono, PuTTY, Zope, Xiph, GnuPG, CUPS, Wireshark, TWiki, Django, available on CodePlex, and many organizations worldwide (for simple standard use, SVN is probably the best choice) Git users: Linux kernel, GNOME, Perl 5, X.Org, Cairo, Qt Development Frameworks, Samba, OpenEmbedded, Ruby on Rails, Wine, Fluxbox, Openbox, Compiz Fusion, XCB, ELinks, XMMS2, e2fsprogs, GNU Core Utilities, DokuWiki (plenty of “geek-style” GNU/Linux stuff) ==> becomes a standard... but more tricky than SVN.