SVN Tutorial
From DojoWiki
This Tutorial is being continually updated. Please send an email to mailto:pghcodingdojo@insomnia-consulting.org if you see areas where it can be improved
Like CVS, there are plenty of Subversion tutorials available.
Contents |
Other Tutorials
Some good ones are:
- http://blogs.vertigosoftware.com/teamsystem/archive/2006/01/16/Setting_up_a_Subversion_Server_under_Windows.aspx
- http://wiki.beyondunreal.com/wiki/Setting_Up_A_Subversion_Server
I'll walk through my own setup and highlight any sticking points and try to add video where appropriate.
Downloading Subversion
Get Subversion here...
There are several different versions, and you may require specific versions (Like Python or Java bindings), but for starters the most recent Win32 binaries are sufficient (as of 12/30/2006 this is svn-win32-1.4.2.zip)
That archive simply needs expanded to a suitable location (C:\ or C:\Program Files).
This isn't the only thing you'll need to download... Other pieces are specified below.
Setup two environment variables
set PATH=%PATH%;c:\svn-win32-1.4.2\bin set SVN_EDITOR=<favorite text editor> c:\windows\notepad.exe OR C:\emacs-21.3\bin\runemacs.exe
Set these Environment Variables from by Right-Clicking "My Computer" and choosing Properties. Then choose the "Advanced" tab and click the "Environment Variables Button".
|
| You can edit PATH and add SVN_EDITOR from here. |
Creating the repository
DOS> svnadmin create <''new directory where the repository will live''>
Repositories can also be created from Tortoise, but I feel more comfortable doing it while I'm configuring the server.
Go to the directory just created <new directory where the repository will live>. In my case the directory wasc:\svnReposso I'll use that as an example from here forward.
Open c:\svnRepos\conf and edit the file svnserver.conf
Uncomment ( by removing the '#' and all leading spaces) from these lines.
[general] anon-access = read auth-access = write password-db = passwd
Next edit the file passwd and remove the '#' before these lines
[users] harry = harryssecret sally = sallyssecret
Create A Project
Start a DOS command prompt and type :
DOS> svnserve --daemon --root "C:\<RepoName>"
This will leave the Subversion server running in a DOS window. Open another DOS window and type :
DOS> svn mkdir svn://localhost/<projectname>
This will launch the editor configured as SVN_EDITOR. Type notes for the new project and save the file.
Notice the username / password prompts. The first prompt is as the user that you've logged in as. You can configure Subversion to use Windows passwords, but that's beyond the scope of this tutorial. Hit "Enter" to skip the initial username, and Subversion will allow you to enter your Subversion username (harry) and password (harryssecret).
I had success using Notepad and XEmacs as the editor. Emacs required some additional utilities to allow it to deal with Windows messages. However, you can also specify the message with "-m message" option, obviating the need for an external editor.
This step of creating a project can be accomplished through Tortoise as well, using the "Import" feature (or from the command line, for that matter.
In fact, using svn mkdir creates an empty project, and import causes the files imported to initially populate a new project.
Running Subversion as a Service
This isn't necessary for running Subversion. You can use the svnadmin daemon to run Subversion, but considering how Windows "prefers" services over daemons, this is probably an appropriate measure to take.
If the svnadmin --daemon is still running, from earlier in the tutorial, stop it now. Click <CTRL> - C
Download, from that site, the most recent .msi file (SVNServiceSetup-0.5.0.msi as of 1/10/2007).
Running the .msi installs, but does not configure the SvnService. Go to the directly where you installed SvnService and run SvnServiceAdmin.exe
- When I did this, I received and error; clicking 'OK' allowed me to continue and I completed the form as shown below
|
|




