Sunday, August 22, 2010

SVN and its configuration

Subversion is a free/open source version control system. That is, Subversion manages files and directories, and the changes made to them, over time. This allows us to recover older versions of our data or examine the history of how our data changed. Thus this can be regarded as "time machine"

I have configured svn server for the people of an organization giving SASL authetication and per-directory authorization. Here are the steps and solution to possible problems. First, i am going to revise some of the important svn command for Linux(Debian).

First of all we need to install a package named subversion from package manger.

sudo apt-get install subversion

After successful installation of the software, we can easily create the repository.

svnadmin create /path/to/repository creates the repository

Once repository is created, some of the files will be added in the location of the repository.Three sub-directories that will be available are /conf, /db, /hooks, /lock. The use of these sub-directories will be explained later.


After creating the repository we need to import the data in the repository.For importing data,create the directory to which needs to be imported. The following command imports the data into the repository

cd /path/to/import/directory

svn import file://localhost/path/to/repository --message "some additional information"

The above command is for the local system. If you need to import for repository which his in network, then following command works

svn import svn://host-address/path/to/repository --message "some additional information"

Once the data are imported, it gets stored in the /svn directory. Now, we need to get the working directory.For getting the working directory we can enter the following command.

First of all we need to create the working directory where we want to keep the working copy.

mkdir /path/to/working/directory

cd /path/to/working/directory

svn co file://localhost/path/to/repository

This is for the case when repository is in local system. And for the repository which is in network, the following is the command:

svn co svn://host-address/path/to/repository

Once the working copy we get, we can make changes on that copy and test it and if we really wants to make changes then we can commit it. Committing makes changes to the repository file too. We should not have a misunderstanding that it will make change into the original repository file. The changes will be made to the files which will later be released as new version.Committing can be done as using the following command sitting in the working directory.

svn commit





No comments:

Post a Comment