Subversion: A Quick Primer
I won't bore you with what Subversion is. If you have found this post, then you already know what it is, perhaps you have even have tried to install it, or maybe even have used it.
When I decided to setup a local Subversion server, I found that while there was several guides on how to do it, not one completely got me going. What follows is what worked for me. While it may not be 100% complete for you, I hope it does help point you in the right direction.
For this guide I am using Ubuntu 8.04 LTS as my server. This guide assumes you have at least a good working knoweldge of Ubuntu, Linux, and are not afraid of the command line. With that in mind, let's get going.
First off we need to install Subversion.
sudo apt-get install subversion libapache2-svn
Once that has completed we should be able to create our repository. Personally I installed my /svnrepos/project
sudo svnadmin create /path/to/repos/project
Next you will want to setup the permissions on the repos you just created. First setup your login to the repo.
sudo nano /path-to-repos/project/conf/passwd
At the end of the file add the a line in the format as the examples show in the file.
jeff = password
Personally I use the same login name I typically use the same username my linux user account is on the box. Next you need to edit the conf file.
sudo nano /path-to-repos/project/conf/svnserve.conf
Here we want to uncomment 3 lines and edit one so they are like this:
anon-access = none
auth-access = write
password-db = passwd
There is of course more options in the terms of security and such, but these basic settings will get you up and running.
Now we need to start the server.
sudo svnserve -d -r /path-to-repos
After that we can now import our files. There is a couple of ways to do this. If you are doing this from the server where subversion is installed, you can use this command to import:
sudo svn import /path-to-local-directory file:///path-to-repos/project --username username
You should be promoted to enter the password you designated in the passwd file above.
If you are doing this remotely from a linux machine you can use this command:
sudo svn import /path-to-local-directory svn://svnserver/project --username username
And if you want to upload your repo from a windows machine, you will need a subversion client. I use sliksvn. From the command line I use the following to import:
c:> svn import -m "project" --force-log path-to-local-files svn://svnserver/project --username username
After that, you are ready to go. To check out a project:
svn co svn://svnserver/project /local-project-folder --username username
To commit the changes:
svn commit -m "Saving Changes" /local-project-folder
There is a lot more to Subversion, but I hope that this guide has helped you your own copy up and running.
Comments
This article hasn't been commented yet.

Write a comment
* = required field