A quick introduction… Store your Time Machine backups online with Time Warp
Jul 19

Everyone who has ever worked on a development project knows that version control is extremely useful. Version control is implemented by several systems, including Git, Mercurial and Subversion (SVN). In this tutorial, I will show you how to set-up a remote subversion repository on your Mac with the beautiful Versions app.

create repository

This window allows you to add a repository to Versions.

Setting up Subversion

You will need a subversion host. There are many services that do this, but for the purpose of this post, I will be using Beanstalk, a beautiful subversion hosting service that includes a free plan with one repository, 100MB space, and three users. The free plan is pretty bare-bones, but it is the most usable free subversion host that I have found. Another host, Codespaces gives you more space, unlimited projects and just two users, but is much harder to use than Beanstalk. After learning how to use subversion, it may make sense at some point to migrate to Codespaces for a more robust feature-set.

To get started, to download Versions. Then, press the button labeled “Free Online Repository”. This will bring you to Beanstalk and start the registration process. Once your account is ready, you can create a new repository in Beanstalk. Because they only give you one repository, I suggest having one big repository where you can store projects. After this is finished, enter the subversion location and your username and password into the “New Beanstalk Bookmark” sheet.

new beanstalk bookmark

This sheet helps you add your Beanstalk repository to Versions.

Working with Subversion

You are done creating the repository. Now, you need to understand how to work with it. Each project in your repository should have the following folders: branches, tags, and trunk. trunk is where all of your work goes. For now, don’t worry about the other two folders. You can create these folders in Versions by right clicking in the Browse view and selecting “New Folder”. When you are ready to put your own work into trunk, just right click the folder and select “Import”. Now, select the folder you wish to import into your repository and below, select its destination.

import

This sheet lets you import existing folders into your repository.

Versions will upload these files to your subversion repository. Once it is done, you can browse the repository in Beanstalk and see your files. Note: this operation did not somehow connect your repository with the files that you imported; it copied them to the repository. You can now delete the original folder that you imported from your hard drive.

Now, you’ll probably be wondering how you edit those files. All you have to do is click the “Checkout” button on the toolbar and a working copy of your repository will be saved to your hard drive in a location of your choice.

checkout

This button downloads a working copy of your repository to your hard drive.

This is where you will be doing any editing of files. From Versions, you can commit changes from your working copy to your repository with the “Commit” button, as well as bring down changes from the repository to your working copy with the “Update” button. This feature is useful when collaborating with a team on a project using the same repository.

Working with files

You can compare different versions of files in Versions using the “Compare Diff” button. It produces a window that shows all code-level differences between versions of files.

comparediff

Compare different versions of files.

Troubleshooting Subversion

If you try to use Subversion with an Xcode project (I am not referring to Xcode’s built-in subversion support), you may get an error relating to the build folder when you try to commit. This can be repaired by the following Terminal commands within your working copy:

cd trunk
rm -rf build
svn update
svn remove build
svn commit -m "fixed build folder svn issues"

Now, your build folder will cause you no more problems.

Conclusion

I hope that this tutorial has been helpful to you, and that you begin to enjoy the benefits of a version control system.


Spread the word:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Reddit
  • Technorati
  • Tumblr
  • Twitter

4 Responses to “Setting up SVN with Versions and Beanstalk”

  1. [...] show you how to set-up a remote subversion repository on your Mac with the beautiful Versions app. Continue reading » Tags Categories [...]

  2. Rizma says:

    Thanks for posting this great SVN tutorial for Macs. We’re a Mac shop, and instead chose CVSDude (http://cvsdude.com) because we can instantly integrate with our basecamp and fogbugz accounts, and their support team always replies right away– day or night.

  3. jonsterling says:

    I’m glad you liked it. CVSDude looks pretty nice as well.

  4. [...] previous post explained how to set up Subversion on your Mac using Versions. After some further experience with [...]

Leave a Reply

preload preload preload