Top

Get started with Subversion using SvnX

January 19, 2009 by Sukrit Dhandhania 

A very important part of a development environment is source code control. Subversion is the server-side software that I use for this. There are a number of SVN clients for the Mac. Let’s take a closer look at setting up my favorite SVN client for the Mac - SvnX.

SvnX is a free and open source SVN client for the Mac. It has a rather simple user interface and supports most features required for SVN work. Let’s install it to get a better idea of what it can do. Head over to the SvnX site and download the latest release. After your download completes it should extract automatically. Drag and drop the SvnX application into your system’s Applications folder. That’s it, the installation of SvnX is complete. SvnX is a front-end for the SVN client, and therefore we need to also install the SVN client binary for SvnX to work.

Download the SVN client binary from here. Extract the file you download and copy the svn binary file to /usr/local/bin/

Double click on SvnX in your Applications folder to launch it. The first screen will look something like in the image below. There are two windows here, titled Working Copies and Repositories. You’ll get a better idea of what these two are as we go along.

Before we get into the details of configuring SvnX here’s a quick explanation of how SVN works. There is a repository hosted on a central server which keeps a copy of the documents for project. This could be code or other kinds of documents. The repository maintains versions of the documents. Every time you “check in” new versions it adds a “tag” for the new version so that you can retrieve an older version of the document at any time. Here’s a very good introduction to how SVN works.

To configure SvnX click on SvnX in the application’s menu and then choose Preferences. In the Preferences window enter the path of the svn binary, which is /usr/local/bin/ in our case.

Now let’s configure SvnX to work with your repository. For the purpose of this exercise I will use a repository that is hosted at the following address - “http://svn.sevenacross.com/project”. The username and password for this repository are “calvin” and “calvin123″ respectively. Please replace these with the information for your repository.

In the window with the title Repositories add the address of your repository, the username, and the password:

After you’ve entered all this information double click on the the entry for this repository to launch it. you should get a window that looks like the following:

It would contain a set of directory in the navigation area at the bottom. Select the directory you want to “check out” and click on the button svn checkout at the top of the window. A finder window should pop up asking where you want to “check out” the documents. After the process of “checking out” the code is over you will find an entry for it in the Working Copies window.

You are ready to begin working with these documents. Now open finder and go to the directory where you “checked out” the code. Edit one or two documents by adding a line of text or a few words somewhere and then save the files. Return to SvnX and double click on the entry for the project in the “Working Copies” window. You will find the files you modified listed in the window that opens. Select them and click on the Add button. Now enter these modified files back into SVN by clicking on the Commit button. Now if someone else were to “check out” this project out of your SVN server she will see the new files with a new tag.

Suppose there are many people working on this project you need to make sure you have the latest version of the documents before you start working on it again. To do that double click on the project entry in the “Working Copies” window and click on the Update button. This will fetch all the latest revisions for all the files that are part of this SVN repository.

There are many things that you can do using SvnX such as moving a section of the repository, or finding the differences between multiple files… but they are beyond the scope of this article. Feel free to read up the project’s documentation or to play with SvnX to discover how to perform these tasks.

Random Posts

To receive articles like this one delivered directly to your inbox, enter your email address in the field below. You can always opt out of these updates at any time.

Share/Save/Bookmark

Comments

3 Responses to “Get started with Subversion using SvnX”

  1. Sumesh on March 20th, 2009 7:42 am

    I develop WordPress themes locally - using MAMP on OS X. I’d appreciate if you can write a post on using SvnX to maintain a theme directory in subversion, and update the files to a test WordPress install on MAMP (at Applications/MAMP/htdocs/blog/wp-content/themes/theme_name).

    Right now, I just duplicate the theme files and place them outside of the MAMP directory, but this is time consuming and has no version tracking. I’ve wanted to use Svn, but didn’t find a guide for this particular use.

    I realize there may be a rather narrow audience for this post - but designers with no knowledge of Svn will appreciate the benefits of it if you can write a tutorial. I’d submit it to a few Digg-like sites for design too.

  2. Asu on April 20th, 2009 9:45 pm

    You’ve mentioned connecting to a HTTP URI but not everyone will have that setup. If you could let us know how to setup a local repository and how to make use of SvnX that would greatly help. Thanks.

  3. Ann on March 25th, 2010 1:47 am

    If you are using MAMP, you can try this good add-on package, which permit you to get Subversion server, and Trac (edgewall), on you MAMP. It’s very easy to setup and works out from box.

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!





Bottom