Prerequisites:
- Subversion Binary (http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91)
- TortoiseSVN (http://tortoisesvn.net/downloads)
- 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
- Install Subversion binary.
- Make sure that the bin directory of Subversion is under PATH environment variable.
- Set any text Editor’s path as SVN_EDITOR environment variable. (e.g. c:\windows\notepad.exe)
Step 2
- 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.
- Go to the repository folder (e.g. codeRepo)
- Edit /conf/svnserve.conf file
Uncomment following:
[general] anon-access = read auth-access = write password-db = passwd
-
- Edit /conf/passwd file
Uncomment following / specify allowed username & passwords:
[users] harry = harryssecret sally = sallyssecret harit = harit’s password
Step 3
- Start svnservice
svnserve --daemon --root "d:\codeRepo"
- Add new Project directory by
svn mkdir svn://localhost/myproject
- 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!
- Setup svn-service to start at startup
svnservice -install --daemon --root "d:\codeRepo" sc config svnservice start= auto net start svnservice
- 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: