posts - 221,  comments - 12339,  trackbacks - 332

I have a couple of personal projects started that need to have a source control repository where they can be sure and accessed from everywhere. The original idea was Source Safe, but if any of you tried before to set it up in a remote internet server and access to it through the web then you must understand why I started to look for a better solution

I found Subversion, a brand new source code control based on the same principles as CVS and started as a replacement for the mess on the last mentioned. Subversion was open-source, free and has windows ports. It also have a large community dedicated to its improvement and tool development.

So let's start with this short tutorial on how I started to use Subversion as the code repository for my personal projects and how not to rely on Source Safe for internet based repositories.

1. First, we will need to download the required software to install Subversion, so let's start:

  • Download the latest Subversion Win3 binaries with Windows Installer
  • Download TortoiseSVN, a Subversion Administration interface that integrates with Windows Explorer as a Shell Extension.
  • Download RapidSVN, a Subversion Client application that I prefer to use in client computers instead of TortoiseSVN, although TortoiseSVN also works perfectly.
  • Download SVNService, a tool that allows installing Subversion Server daemon as a Windows Service.

2. Run the Subversion installer on the selected server to hold the code repository. This should be as smooth as double-click on the MSI file, so no more attention to pay here.

3. Create a folder in your file system where all the Subversion projects will be stored. This is not really needed, because each project can be in each own folder, but I prefer to have one single folder where the entire repository resides. I created a C:\SvnRepo folder to store my project database.

4. When installation finish, you should start the Subversion Server. This is done by starting the bin\svnserve.exe service, but it’s an ugly way to do it because it creates a command window that you have to minimize; and it would be running only when you are logged into that machine. The best way to accomplish this task is by installing it as a Windows Service with the help of SVNService: uncompress the file you downloaded into the Subversion bin folder and run SVNService -install -d -r c:\SvnRepo in the command window to install the service with the specified parameters (be sure to specify the right path to the folder where you want to create your projects)

5. Start the SVNService from your Windows Services Snap-In and set it to Automatic start-up. This way it would be started every time the server is restarted.

6. Start the installation process of TortoiseSVN on the same server where Subversion is installed. This will allow you to administer your Subversion server, but have in mind that should restart your server prior to use the TortoiseSVN shell-extension to manage Subversion.

7. Go to the Subversión Repository folder you created to store your projects (c:\SvnRepo in this guide) and create a folder to store a Test project. Name the folder TestSubversion. Using the windows explorer in the Subversion server, right-click in the folder you have just created, expand the TortoiseSVN menu and select the ‘Create Repository here’ option. This added a new code repository to Subversion.

8. Try to connect from the Subversion server to the code repository you have just created. Right-click in any place within the windows explorer interface, expand the TortoiseSVN menu and select the ‘Repo-Browser’ option. In the dialog window that appears enter the URI to access your Subversion repository, svn://localhost/TestSubversion in this case. Take in mind that svn:// is the prefix for Subversion URIs, localhost can be replaced by any URL that points to the IP of the server where Subversion is installed and finally, the TestSubversion states for the repository where you want to connect.

NOTE: If your are firewalled, or trying to access from outside the server where Subversion is installed, have in mind that your proxy should allow access to the port 3690

9. You can perform the normal source control operations: view, delete, add, modify, check-out, check-in, etc… To add full projects it’s easier to Import the full project using the Import option from the TortoiseSVN menu.

And if everything worked from within your Subversion server, test it from another computer on the same network, or over the Internet. But you sure have noticed that everything is unsecured yet… So let’s start to secure the code repository:

1. Go to the repository folder you created (in our case ) and open the conf folder. There you should have a svnserve.conf that defines permissions for accessing the Subversion server. This file is quite simple:

[general]

anon-access = none    ## Can be none, read, write

auth-access = write   ## Can be none, read, write

password-db = passwd  ## Filename of users store

realm = TestProject

 

Now we should create a passwd file to store the usernames and password used to control access to the repository. This file contains a [users] section header and then a single user for each line in the form of USERNAME = PASSWORD, where both username and password are case sensitive:

[users]

Miguel = myPassword

In a couple of days I’ll prepare another article on how to integrated and use Subversion as the SCC Provider with Visual Studio .NET 2003. In the meantime you can find more information on working and administering Subversion by consulting the O’Really Version Control with Subversion book, which is freely available to download.

posted on Friday, January 21, 2005 1:35 PM

Post a new comment about this topic
Title  
Name  
Url

Comments   
Protected by Clearscreen.SharpHIPEnter the code you see: