Keeping Your Codes Safe With SVN Tool
Being a research scholar, I understand the pain of losing your code, files or work. This has happened to me many times in the past and I always regretted for not having the backup. For last one year I am using SVN to keep my stuff safe that too with access to the past modifications.
Here is the step by step procedure to set up SVN server on a lab or local machine:
- Download and install "subversion" package. In Ubuntu, you can go Synaptic Package Manager, select and in stall it easily.
- Make a repository directory in a place which is possibly isolated from your
work directory( e.g. /var/svn/repos/). You may need super user privilege.
$sudo mkdir /var/svn $sudo mkdir /var/svn/repos - Make sure that you own this directory (place your user-name below).
$sudo chown -R /var/svn/repos/ - Create an svn user by editing the following file:
Add these three lines in the above file:$vim /var/svn/repos/conf/svnserve.conf
The first line restricts any unauthorized access, second, allows an authorized user writing access and third, specifies the passwd file in which all the registered user are mentioned (more details below).anon-access = none auth-access = write password-db = passwd - Edit/create the passwd file to create authorized users with their passwords:
Specify the name of the user and the corresponding password in the following format:$vim /var/svn/repos/conf/passwd achint = mypassword - Though you can add your files to the repository now, but I would strongly
recommend you to first checkout the repository and add your files one by one to
it. For this first start the svn server as a demon (it will run in the
background):
$svnserve -d - Checkout the repository directory:
This will create a local directory "repos" in your current directory.$svn co svn:// /var/svn/repos - Add your files/codes to the repository by first, pasting files in "repos"
directory and then add those files in the svn:
$svn add - After adding all the files in svn, commit the changes made by the following
command:
$svn commit