Installing Subversion and Git

Steve Popoola —  May 11, 2012 — 1 Comment

There is no doubt that the two most used and popular Versioning Control Systems (VCS) are Subversion and Git.

In any project where you have teams working with the same documents (Porject teams, developers, etc)  the need for a versioning control system cannot be overemphasized.

Having worked with both Subversion and Git, I have decided to share the steps required to install these two systems. Although they can be installed on any OS, I am assuming a Linux operating system, since that is the one I often use  and quite familiar with.

Installation

If you are using Ubuntu, then getting subversion is quite straightforward. All you need to do is issue the following command;

sudo apt-get install subversion 

Next step is to create the directory which will house the resository. This could be anywhere you choose on your filesystem.

sudo mkdir /var/svn/repos 

Next, you change the permissions on the filesystem so that only the svn user and group have access to the repository(s)

$ sudo chown -R svn:svn /var/svn/repos
$ sudo chmod -R g+rws /var/svn/repos 

If you have a user account on the same server, you can add yourself to the svn group;

sudo usermod -a -G svn steve

You are now ready to create your repository. This done using svnadmin;

svnadmin create /var/svn/repos/myproject

At this point you can either checkout the new empty repository or import your existing files into the repository.

To checkout the repository on the same server, you run the following command;
$ svn checkout file///var/svn/repo/myproject
$ checked out revision 0

SVN Protocols
There are various protocols for accessing svn repositories. These can be found in the Subversion manual at http://svnbook.red-bean.com/

The most common however is using the svn protocol. In order to access using this protocol, you must have svnserve running as a background process to listen for connections.

But first, we need to make some configuration changes and secure the repository.

Edit the file /var/svn/repos/passwd. The format for each entry is
user = password
Enter your svn users in that format and save.

Next, we need to edit the svnserve.conf file. There are default configurations there but you can change it to the following and save the file ;
[users]
steve = mypass
kate = herpass

Now to run the deamon process;
$ sudo svnserve -d --foreground -r /usr/local/svn/repos

In order to run svnserve at bootup, you will need to create an init script. Details can be found on this blog http://odyniec.net/articles/ubuntu-subversion-server/

So all that is left now if for you to access your svn server
$ svn://your-server-ip/yourproject myproject --username

Enter your password and you checkout your project.

Next post, I will write on how to install and configure Git

Steve Popoola

Posts Google+

One response to Installing Subversion and Git

  1. Many thanks!So far, I’m rlleay liking Subversion; although in the general case in which the externals form a directed acyclic graph instead of a tree, it would be nice to have the option of avoiding working copy duplication.I’m tempted to code a program that recursively traverses a working copy and deletes duplicate directories, putting symbolic links in their place. That wouldn’t eliminate the checkout overhead, however.Again, thanks for the info.

Leave a Reply

*

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>