
We will show you how to install SVN in Linux. Subversion or commonly abbreviated as SVN is an open-source software versioning and revision control system. It allows users to maintain current and historical versions of files such as source code, web pages, documents, and other electronic data. Installing SVN in Linux, is not so complicated, just follow the steps in the tutorial below and you should have it done in 10 minutes. We are also going to show you, some basic SVN commands in Linux.
Table of Contents
1. Connect via SSH
In order to install SVN, connect to your Linux VPS via SSH.
Please remember to replace 1.1.1.1 with the IP address of your server and 2222 with the listening port of your server’s SSH daemon.
2. Update the OS Packages and Install SVN in Linux
If you are using an Ubuntu VPS, update the OS packages and install SVN on your server using the commands below:
If you are using a CentOS VPS, you can use the following command to update the OS packages and install SVN:
3. Check SVN Version
To check the version of SVN installed on your server, use the following command:
4. Create a system user account
Create a system user account and switch to that user:
Replace ‘someuser’ with the actual username.
5. Create a new directory for your project/application/website files:
Create an SVN repository using the following command:
6. Configure permissions
Set the proper file permissions. On Debian based distributions, run:
On RPM-based distributions (if using Apache as a web server), run:
7. Create a ‘passwd’ file
Create a ‘passwd’ file to the /home/someuser/svn/myapp/conf/passwd directory on your server which contains user authentication details:
If you want to add additional users, use the same command, but without the ‘-c’ switch to avoid overwriting the passwd file.
Assign permissions to SVN users using the authz file (/home/someuser/svn/myapp/conf/authz):
8. Create the conceptual groups, configure permissions
Create the conceptual groups you want, then add people to it:
Choose what access they have from both the permissions and project level:
To give read and write permissions to ‘allaccess’ users, add:
To only give read-only access to ‘someaccess’ users to some lower level project, add:
9. Other Commands for SVN in Linux
In order to copy an unversioned tree of your project/website files and begin tracking in your SVN repository and create intermediate directories, use the following command:
You can create a single repository for each project/website at some central place where all the history is and which you checkout and commit into.
To create a working copy to another local directory, use:
In order to send changes from your working copy to the repository, use:
Use ‘svn add /path/file’ command to add a file from the working copy to the repository). File will be added to the repository when you do an svn commit.
To delete a file from the working copy (or repository), use:
and the file will be deleted from the repository after the svn commit command.
To update changes from the repository into a working copy, use:
If there are multiple authors working on the project/website and they have local working copies on multiple machines, always run the ‘svn update’ command before making changes to files available in your working copy. After that, make changes to files, then commit changes to the repository once the files are done being modified.
In order to apply the differences between two sources to a working copy path, use:
To see the differences between the two specific revisions of a file, use:
Of course, you don’t have to Install SVN in Linux, if you use one of our Subversion Hosting services, in which case you can simply ask our expert Linux admins to install and configure SVN in Linux for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post on how to install SVN in Linux, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.
Why? There is a good reason people have moved to Git. There isn’t a good reason to stay with SVN…
It is a matter of personal choice. Both systems are great.
I think you meant “svn merge” instead of “svn megre”
Good catch, this was corrected. Thank you.