Monday, January 01, 2007

How to setup SVN on windows

1. Download
Subversion Find server side component, svn-1.4.2-setup.exe is for windows setup.
Svn service Run svn server (svnserve.exe) as MS Windows service (Don't need since SVN v1.4)
TortoiseSVN Client side component

2. Install and setup SVN server
Run setup file. Then Create a repository and configure access:
Create a new directory like d:\subversion\repositories, open a command line window and go inside this folder, run

svnadmin create "
d:\subversion\repositories"

This will create repository stucture folder under d:\subversion\repositories, go to d:\subversion\repositories\conf, change file svnserve.conf, uncomment the following line:

[general]
password-db = passwd

change file passwd, uncomment the following line:

[users]

and add the username and password you want to use when connecting to your subversion server

3.Install svnservice, and run install.bat to install a service for SVN, then start service "Subversion Service"

Note:
From v1.4,
svnserve can be run as a native Windows service. Use windows command line tools sc.exe to install svn service.

sc create svnservice
binpath= "c:\Subversion\bin\svnserve.exe
--service -r D:\svnroot"
displayname= "SVNService"
depend= Tcpip
start= auto

where "svnservice" is any service name, and "D:\svnroot" is the repository, you can use --listen-port parameter as well.

Then you can use the following to start/stop svn service
net start
svnservice
net stop
svnservice

To delete svn service
sc delete
svnservice

If the path to svnserve.exe contains spaces or other characters that
must be escaped, then you must enclose the path to svnserve.exe with
double-quotes, which themselves must be quoted using a backslash:

sc create
svnservice
binpath= "\"c:\program files\subversion\bin\svnserve.exe\" ..."


4. In client side, install TortoiseSVN and reboot computer, then create one projects folder like d:\projects and right click this folder and click "Import" menu, use URL:

svn://ip/projects
The default port SVN used is 3690.


No comments: