How To: Install SVN on Mac

If you’ve open the terminal and run the “svn” command just to be told “-bash: svn: command not found” then do the following:

1) Install XCode
2) Open “Preferences” and click the “Accounts tab”
3) Add your Apple ID
4) Open the “Downloads” tab
5) Click the download link next to “Command Line Tools”
6) You  have SVN!

XCode Downloads

How-To: Recursively remove .svn folders

Okay, so you’ve accidentally adding a bunch of files to SVN.  Or, you need to copy a bunch of files but you don’t want to take the .svn folders with you.  How to get rid of these?  On any *nix machine (Mac included) you can run the following command:

rm -rf `find . -type d -name .svn`

How-To: Move change the address of a SVN repository

So you’ve changed where you host your subversion repository for a particular project and you want to update your local copy so that it points at the correct address?   How do you do this?  Simple:

svn switch --relocate http://oldserver.com/PROJECT 
                      http://newserver.com/PROJECT

This will recursively modify all the .svn folders contents so they point to the correct location.

How-To: Install Subversion (SVN) 1.5 on Mac OS X

We use CVSDude.org to host all our subversion repositories.  They have recently upgraded to subversion 1.5.0 which is not compatible with 1.4.x clients.  Unfortunately the command line utility that is built into Mac OS X is only at version 1.4.4 on my MacBook Pro – so I needed a way to upgrade to version 1.5.

I’ve found two ways to do this:

Either of these methods allow you to access SVN 1.5.0 repositories.
 

Hosting Your SVN Repository: CVSDude.com

As a developer, it is really important to have a reliable code repository. I use SVN (subversion) for all my projects and have been looking around for a decent way of outsourcing the repository – I want it accessible to all my staff all the time, it should also be secure and redundant.

We have now settled on CVSDude.com, an Australian based company (with it’s servers in the US), which has a huge following in the developer community. We’ve been using them for over a year now and have found their service to be fantastic.

The web-front end administration isn’t awesome (it needs a bit of a UI overhaul), however its perfectly useable. You can create multiple repositories (based on the package you purchase), create multiple users and get lots of space. We have the 3GB Team Pack with costs only $15US a month.

Communication with the US based repositories is lightning fast, which is what really counts, as you don’t want to be waiting around for your code to check in, or while you are doing a large diff.

I can thoroughly recommend CVSDude.com if you have any size team and need all the advantages of hosted SVN.


CVSDude registered logo

TortoiseSVN for Mac OS X: SCPlugin

I’ll admit I’m a recently reformed windows user, as I’ve really only been using a Mac for the part 8 months. One thing I really missed as a developer when switching to the Mac was a nice integrated SVN client like TortoiseSVN.

Thankfully, there is SCPlugin – a Finder plugin for Mac OS X which provides full SVN integration. It’s fantastic and allows you to do authenticated remote checkouts, updates, diffs, commits etc all from the comfort of the finder. When a folder is under SVN control, a little green tick appears in the left-hand corner of the folder.

To use the full range of SVN commands on the folder or file, simply right click the folder, choose “More” and you are presented with a range of SVN commands to choose from:

SVN in Finder

You can download SCPlugin from the project files listing here.

SVN: Creating a new project using command line

I always forget the syntax for creating a new project using SVN via the command line. So here it is:

svn import <directory> <repository path> -m “Initial checkin”

Where the directory should contain the files you want to add to the repository, and the repository path should be something like:

svn+ssh://evan@charzard/usr/local/svn/repository/trunk/1.0/<project name>