Category Archives: Subversion

Setting up Subversion under windows

Prerequisites:

  1. Subversion Binary (http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91)
  2. TortoiseSVN (http://tortoisesvn.net/downloads)
  3. SVN Service Wrapper for Windows (http://www.lw-works.com/files/svnservice/svnservice-1.0.0.msi) – svnservice

Alternate to 1 & 2 – download 1 Click Setup (http://svn1clicksetup.tigris.org/)

Step 1

  1. Install Subversion binary.
  2. Make sure that the bin directory of Subversion is under PATH environment variable.
  3. Set any text Editor’s path as SVN_EDITOR environment variable. (e.g. c:\windows\notepad.exe)

Step 2

  1. Create code / document repository (the main destination or data centre!!)
svnadmin create "d:\codeRepo"
               Alternatively, you may also use explorer’s context menu to add selected folder as repository using TortoiseSVN.
  1. Go to the repository folder (e.g. codeRepo)
    1. Edit /conf/svnserve.conf file

Uncomment following:

                               [general]
                               anon-access = read
                               auth-access = write
                               password-db = passwd
    1. Edit /conf/passwd file

Uncomment following / specify allowed username & passwords:

                               [users]
                               harry = harryssecret
                               sally = sallyssecret
                               harit = harit’s password

Step 3

  1. Start svnservice
               svnserve --daemon --root "d:\codeRepo"
  1. Add new Project directory by
               svn mkdir svn://localhost/myproject
  1. Provide correct username & password (that is configured earlier)

Otherwise, use SVN repository browser to browse SVN repos. Right click provides rich set of options like adding new files/folders, delete, etc. etc. Use svn://localhost/myproject or similar as URL to browse.

Optional options!

  1. Setup svn-service to start at startup
               svnservice -install --daemon --root "d:\codeRepo"
               sc config svnservice start= auto
               net start svnservice
  1. Bind windows user for authentication (see source link 1 – http://www.stanford.edu/~bsuter/subversion-setup-guide/#svnserve-windows-user)

Please make sure that the svnservice is running correctly. Use Control Panel > Administrator Options > Services > Subversion (or whatever you named it) to verify. If the service is not running, it is the root of many problems.

This setup also works on network. You can access this repo through other machines connected through network. Each time you modify the files and commit, subversion will do authentication based on username and commit new version.

Major advantage of subversion – old (and deleted) files remain there in repository and can be retrieved back, so is perfect backup solution for code!

Sources for more advanced setup:

  1. http://www.stanford.edu/~bsuter/subversion-setup-guide/
  2. http://blogs.vertigosoftware.com/teamsystem/archive/2006/01/16/Setting_up_a_Subversion_Server_under_Windows.aspx
  3. http://blog.excastle.com/2005/05/31/mere-moments-guide-to-installing-a-subversion-server-on-windows/
%d bloggers like this: