InstallLet install subversion (if you followed previous post on how to mount ext3 partitions securily, you will need remount /usr and /var so they can be used by apt):
apt-get -y install subversion
Create repositoryOnce Subversion is installed, the next step is create your repository. We are going to keep all our repositories below /var/lib/svn/repos directory.
deby:~# mkdir -p /var/lib/svn/reposThe only users of security group svnusers can access repositories.
groupadd -r svnusers chgrp svnusers /var/lib/svn/repos chmod o-rwx /var/lib/svn/repos ls -l /var/svnAdd users to group svnusers:
usermod -a -G svnusers user1There are two common conventions for organizing projects. One is project major, and the other is project minor. In project major, each project has its own repository; in project minor - the repository is top-level. Here is a command to create svn repository for project1 using project major convention.
svnadmin create /var/lib/svn/repos/project1Let secure project repository (consider use per project group assignment).
chgrp -R svnusers /var/lib/svn/repos/project1 find /var/lib/svn/repos/project1 -type d | xargs chmod g+x chmod -R g+w,o-rwx /var/lib/svn/repos/project1Now login as user1 and checkout:
user1@deby:~$ svn co file:///var/lib/svn/repos/project1/ Checked out revision 0.
Repository top directoriesIt is recommended create the following top level directories: trunk, branches, tags.
user1@deby:~$ cd project1/ user1@deby:~/project1$ svn mkdir trunk branches tags A trunk A branches A tags user1@deby:~/project1$ svn commit -m 'added top directories' Adding branches Adding tags Adding trunk Committed revision 1.