Version control with Apache Subversion in Ubuntu
To install Subversion
sudo apt-get install subversion libapache2-svn
Create SVN Repository
Assuming that we are putting the Subversion repository in /home/svn, and your project’s name is simply ‘myproject’
$ sudo mkdir /home/svn
$ cd /home/svn
$ sudo mkdir myproject
To create SVN repository:
$ sudo svnadmin create /home/svn/myproject
To give necessary permission
$ cd /home/svn
$ sudo chown -R www-data:subversion myproject
$ sudo chmod -R g+rws myproject
To restart apache2 web server:
sudo /etc/init.d/apache2 restart
svn import /path/to/import/directory file:///path/to/repos/project
To add the first first user:
sudo htpasswd -c /etc/subversion/passwd user_name
It prompts you to enter the password.
To add more users after that:
sudo htpasswd /etc/subversion/passwd second_user_name
To access the repository:
$ svn co http://hostname/svn/myproject myproject –username user_name
or you can use client tools like Tortoise SVN or Rapid SVN