Wednesday, July 18, 2007

Subversion Quick Start Guide

Subversion is one of the prominent FLOSS(Free/Libre Open Source Software) Version Control System, which is very much superior to CVS. It has a nice set of powerful command-line tools through which developers can interact with the source repository. There are also GUI(Graphical Interface) Tools like kdeSVN, NaughtySVN, eSVN, TortoiseSVN for interacting with the repository.

Here is a simple step-by-step configuration guide that may help you to set up a subversion repository for your development projects.

Step 1:
Make sure that the latest version of subversion is installed in your server. Use rpm command in Fedora/CentOS/RHEL and apt-get in Debian/Ubuntu.

# yum install subversion

or

# apt-get install subversion.

You can also install subversion from source. For detailed instructions on compiling and installing subversion, refer the subversion home page(The link is given at the bottom of this page).


Step 2:

Create a new Repository with the following command:
# svnadmin create /home/svn/linuxeyes


Step 3:

Edit the /home/svn/call_centre/conf/svnserve.conf
and enable the following lines :

[general]
password-db = passwd
realm = Linuxeyes Repository


Step 4:
Edit the file /home/svn/linuxeyes/conf/passwd and add the following lines:

[users]
manoj=manoj

You can add as many users in the format USERNAME=PASSWORD. The passwords are not encrypted.


Step 5:
Set a text editor as the default SVN editor:
# export SVN_EDITOR=vi

Now that your Repository and authentication schemes are set, you need to import the development source tree to the server. You can use the file protocol or the SVN protocol to import the files. If you need to make the repository available in a network then you have to set up the svnserve. Issue the command:

# svnserve -d -r /home/svn/

This will run the svn server in daemon mode.


Step 6:

You can now import the source tree with the following command:

$ svn import linuxeyes svn://192.168.0.250/linuxeyes --username manoj

Here “linuxeyes” is the orginal source tree.

You can also use the file protocol to import the tree.

# svn import linuxeyes file:///home/svn/linuxeyes


Step 7:
You can checkout the source by using the command:

$ svn checkout svn://192.168.0.250/linuxeyes

More help can be obtained by using the command : svn help

$ svn help


Resources:

Subversion Homepage: http://subversion.tigris.org/

Subversion Book: http://svnbook.red-bean.com/

P.S: I am now preparing a detailed documentation on setting up a secure subversion repository using HTTPS/SSH. I will post it here once the it's completed.