Subversion

Installation

  1. Download Setup-Subversion-1.5.6.msi
  2. Install it and follow the instruction.
  3. Add the bin directory in the Subversion folder to your PATH environment variable.
    PATH=;C:\Program Files\Subversion\bin
     
  4. Create the environment variable SVN_EDITOR and point it to notepad.exe
    SVN_EDITOR=C:\WINDOWS\system32\notepad.exe
     

Server side configuration

  1. Create a repository in Subversion for your project(e.g. myrepository).
    C:\tmp\test_svn>svnadmin create myrepository
     
  2. Open myrepository\conf\svnserve.conf and add the followings:
    [general]
    anon-access = read
    auth-access = write
    password-db = passwd
     
    It tells the server that anonymous users have read access whereas the authenticated users have write access. In addition, all the user names and passwords should be stored in a file called passwd. passwd is created by default.
  3. To add users, open myrepository\conf\passwd and add users like the followings:
    [users]
    # User 1
    myusername = mypassword
    # User 2
    joe = joespassword
     
  4. Run the following to start the server.
    C:\tmp\test_svn>svnserve -d -r myrepository
     

Using Subversion

Create a directory for your project
C:\onAnotherComputer>svn mkdir --username joe --password joespassword svn://192.168.131.65/myrepository/myproject  
 
myproject is the directory of my project that I would like to create. 192.168.131.65 is the IP address of my Subversion server. After you ran the command, notepad will open so that you can enter a message about the creation of your directory. Save your message and then close notepad.
Import your project(e.g. myproject\ )
C:\onAnotherComputer>svn import myproject --username joe --password joespassword svn://192.168.131.65/myrepository/myproject
 
myproject is the directory of my project that I would like to upload to the Subversion server. After you ran the command, notepad will open so that you can enter a message about the import. Save your message and then close notepad.
Checkout: Download the project you just checked in.
C:\onAnotherComputer>svn checkout --username joe --password joespassword svn://192.168.131.65/myrepository/myproject
 
Add new file or new directory
C:\onAnotherComputer>svn add <file_name>
C:\onAnotherComputer>svn add <directory_name>
 
Note: Add is NOT recursive and smart. If you add a new file under a directory and that directory already exists in the repository, Subversion will NOT recognize your new file if you issue the ADD command on the directory. You have to pinpoint the file like the following:
C:\onAnotherComputer>svn add existing_dir\newFilename.java
 
Commit: Update your changes back to the server and making available to other person
C:\onAnotherComputer>svn commit myproject
 

Add svnserve as service

  1. Create a service for svnserve.
    sc create svnservice binpath= "C:\Program Files\Subversion\bin\svnserve.exe --service E:\svn\repository" displayname= "Subversion Repository" depend= Tcpip
     
  2. Run the created service:
    net start svnservice