Control Your Subversion: Tips for Setting up Subversion on the Mac

subversion_logo_hor-468x64.pngThis is just a little post to help me remember how I got this stuff working.

Subversion is a revision control system that is being developed to replace older similar systems. Revision control lets you update your projects in an iterative fashion and allows you to keep track of these changes. This is perfect for when you have a bunch of people working on the same thing and want an easy way that everyone can work on the same stuff without stepping on other peoples toes.

I have used version control systems on a Java application we developed as a team last semester, and I plan on using it soon to develop web applications, but it really could be used for almost anything: a big proposal, documents for a conference, anything that you might work on in a step-wise fashion.

Plus, it doesn’t have to be a group project to use Subversion. You can use it as an easy backup system so you can work on your stuff from any machine and use it in case you want to revert to an earlier version of something.

They have a free book about how to use / setup Subversion, and there is a lot of info out there on how to use it.

Client

If you have the server set up, using a client to check-in and check-out projects is easy. For Windows there is a client called tortoisesvn that comes highly recommended. I guess it integrates with Windows Explorer to make things easy. For Mac you can use a precompiled command-line version (this one is the most popular and put out by Martin Ott of SubEthaEdit fame) or search for a GUI version. My favorite so far has been ZigVersion. SvnX is also recommended, but froze up when trying to connect to my server (probably because I was initially typing the location wrong).

Server

This is the tricky part. The easiest way to install it on a Mac that I’ve found is using Darwinports and this tutorial. I followed it excatly without any issues. Darwinports is so handy, everyone should have it installed by now. Then I used this section of the book to add basic authentication to my Subversion repository.

New Repository
Now to add a new repository I simply use:

sudo mkdir reposName

sudo svnadmin create –fs-type fsfs reposName

make template and import

cd ~

mkdir svn-template

cd svn-template

mkdir trunk branches tags

Import your template directory into the “reposName” repository using

svn import .http://localhost/svnrepo/reposName -m “Initial import.”

And you should be ready to go. Here’s a list of commands from the book commonly used in messing with the repository:

 

  • Update your working copy

     

    • svn update
  • Make changes

     

    • svn add
    • svn delete
    • svn copy
    • svn move
  • Examine your changes

     

    • svn status
    • svn diff
    • svn revert
  • Merge others’ changes into your working copy

     

    • svn update
    • svn resolved
  • Commit your changes

     

    • svn commit

So that brings together most of what you would need to set up a Subversion server on a Mac, and mess with it. Hope this can help somebody

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: