Dev notes: SVN and versioning


Months ago, I saw the “Evening at Adler” video that DrunkenBatman released, which consisted of Mac indie developers discussing important topics about our platform. Something that they discussed which rang strong with me was a topic known as “versioning”. Basically, when a developer works on a major project, no matter what environment or platform, it’s wise to have a way to control backups, multiple people editing the same file, etc. Something that some developers had recommended to me was called “Subversion”, and sounded cool, but the docs were daunting for me at the time, so I just put it in the back of my mind and moved on with things. I found that simply copying my project folder and renaming it with “backup” in it works just as well… at least, I thought it did. Then, my web, XCode, and other projects began to explode in size – some, even hundreds of megabytes. Over the course of a month, any one of these projects could gain dozens, even more than a hundred backups. I thought 80 gigs was an okay size for a drive, but I was wrong (and I don’t have more than 4 gigs of iTunes stuff).

Well, those developers had said something to the effect of “it’s a bad idea not to have some type of versioning system”. I decided that if I wanted to become a Serious Programmer(TM), I would need to jump on board the SVN bandwagon. SVN is short for Subversion, a system that is installed on your computer or webserver, and you upload your source code/project files/whatever and then download a “working copy”, make changes, and upload the changed working copy. SVN keeps track of the files you’ve changed, and merges those changes with any changes that your co-workers/teammates have made. For instance, if “Bob” and “Jane” both download copies of their project, and Bob uploads his changes, and Jane uploads her copy after Bob, wouldn’t Jane’s files simply overwrite Bob’s hard work? No. SVN will instead help Jane to “merge” her changes with Bob’s, and she can see what he changed. This way, it’s much easier to keep track of those little things.

Did I mention that this isn’t just limited to XCode? I’ve also recently used this system with my web projects as well. It’s a slightly different workflow for me, but it’s nice to have.

There are still some things about it that I’m trying to figure out. Be aware that it’s not for the faint of heart, since as far as I can tell, you need to use Terminal to use SVN. I’m not a big fan of console apps. Does anyone out there know of a GUI frontend for SVN built on Cocoa? I’m in desperate need of one. Something that works similar to Transmit would be sweet.

I marked this post to also be in the “User Feedback” category, because I’d like to get comments from people who have had experience with SVN and how they’ve made it easier for themselves to use. Certainly you wouldn’t open Terminal and type in all of those commands every single time you want to download/upload a project? Is there a way to interface it into other apps, even XCode? Is a graphical client available? What are your experiences?



svn is no harder than cvs to setup and it doesn’t impose the branches/tags/trunk hierachy, that ‘s merely a suggested way of working – the same goes for cvs. You can organise your repository however you like.

Will take a look at cvs-nt :)
But that looks a bit like closing the stable door after the horse has bolted.


CVS isn’t dead. There are now two CVS versions. CVS-NT (at is backwards compatible with CVS but also features equivalent to SVN.

SVN is quite hard to set up and imposes an awkward branches/tags/trunk directory hierarchy for your projects. I don’t like that. I’m staying with CVS and moving to CVS-NT pretty soon.


Not just for programming…

Once you’re comfortable with version control, you may find, like I have, that version control can be used for any computer-based project. Writing, graphic editing, web sites, resumes and CVs, etc., are all good examples of things that can be version controlled. Take resumes for example – I used to have various versions of resumes scattered all over my machines and backup disks. In version control, I have one clear working copy, I have tags grouping which version of the resume I sent out to whom, and I can always go back to review a resume I sent out a while ago. After all, even Adobe has created version controlling systems for their software (Version Cue).

Willis Morse

We use subversion exclusively now for web and Java development. For a client, the best GUI one seems to be SmartSVN as mentioned above. The Mac ones seem pretty buggy and underfeatured. Tortoise on Windows is pretty cool for small scale work, but I really like the way a GUI tool like SmartSVN gives you filesystem tree and a bunch of ways to filter the file views so you only see, for instance, modified files.

One good reason to use a GUI is when there are conflicts during a commit. SmartSVN gives you a nice graphic diff and merge tool. You can hook up the commandline client to use a standalone diff/merge tool, but that’s just one more thing you have to set up and remember how to invoke.

The problems with SVN jamming happen when you the Berkley DB storage option. A better option is the FSFS filesystem, which the svn folks wrote because of the Berkley DB problems.

As far as Perforce goes, I’ve been been really annoyed when I’ve had to use it. It’s VERY server-centric, which means you can’t do anything without a continuous server connection. In order to create a local working copy, you have to tell the server where you want to put it. Once you do that, you can’t seem to move your local copy around without breaking the connection. In contrast, svn stores all info inside .svn folders in your working copy (same as CVS), so you’re free to move it anywhere.

The big new feature that svn brings to the table is support for renaming and moving files and folders without losing the history. You really need this when you refactor, and the lack of it has been a real hassle with Perforce.

Perforce also has this focus on having to check everything out before you can work on it. Many’s the time I’ve checked out a bunch of stuff, gone home for the weekend, then realized I didn’t check enough files out. So I would have to manually unlock the files to make the mods. When I went in and tried to do a checkin, Perforce only knew about the changes to files I actually checked out. So I would have to manually find all the other files I changed in order to check them in, too. Not too painful if there’s only a couple and you can remember what you did, but a serious round of automated refactoring could easily hit 100 files.

Svn doesn’t check anything out, you’re always free to work in whatever file you want and svn keeps track. It also carries around enough info locally that you can do a diff between your changes and the whole repository, without any server connection.

As far as binary file support, it always seemed very easy using Perforce to mis-characterize a binary file as text. Once you do that, as far as I could tell you had to remove the file and readd it with an explicit binary characterization. I found myself doing that a lot. In contrast, svn detects binary file autotmatically and hasn’t gotten it wrong once yet in over 9 months of heavy use.

In general, I found that Perforce really got in the way. Even CVS would have been an improvement.

It could be that there are solutions to my Perforce issues, and I would love to hear them. And Perforce does seem to be some heavy duty admin features that may be useful for large hierarchical organizations working in a common location. But I suspect that after giving svn a serious try, most Perforce users wouldn’t want to go back.


SVN isn’t bad, but I’ve heard of problems where the repository would get ‘jammed’. I think the only reason people are raving about it is because, in comparison, CVS can be a real pain.

Perforce is a really good version control system; it supports ‘branches’ in a sophisticated way. P4v, with all its Java-based UI quirks, is a really powerful client(sometimes almost too powerful in the hands of a novice)I use it with a team at work.

For personal stuff I use Mercurial. It’s simple: you only need to learn 3 or 4 commands to get up and running. It supports branches(everything is a branch). It’s stable, its at 0.91 and I’ve used it since 0.7 without problems. And the rollback feature actually works. Oh, it’s free! Only drawback is there is no Mac UI client yet.

For support there’s a mailing list and Freenode IRC channel, #mercurial


We use Perforce, which is another source control product. It’s very powerful, handles Mac multi-fork files, and is cross-platform. You can use p4v if you prefer a GUI, or use the p4 command line UI straight from Terminal. It also integrated with Xcode and CodeWarrior (although I still say the Xcode integration needs some work here and there). I don’t know if Subversion can do this stuff, but Perforce on the server side can do lots of stuff to keep your data safe and clean, like performing automatic backups, journaling, checkpoints, etc. We like it a bunch, and I know it’s used by lots of large software development companies.


I have been using SVN for a while, and used CVS before it, so the commandline really isn’t a big deal for me. I usually have to look up the commands every once in a while, and then, I’ll get the command I want, and just keep using the UP arrow key to refetch the old line, make a modification to the message, and hit enter.

If you go deep into branching and comparing arbitrary versions to each other, it might be easier with a GUI tool, but I find (as another commenter noted) that most of the time I only need to use about 3 commands repeatedly. On the first checkout, you need to get the command right, but once you are done with that (assuming nothing awful happens), you can pretty much use ‘svn status’, ‘svn commit’, and ‘svn add’ to do all the normal activities. Within the folder for the working copy, you don’t even have to remember the repository location any more.

BTW, I would go so far as to state that ALL computer users should learn to use vesion control software. Heck, even if you were just keeping your game saves under version control, you might save yourself some grief. SVN (unlike CVS) works great with binary files, so you could save all images, etc., and most people doing something on a computer don’t want to go to the trouble to recreate a file that was accidentally deleted, etc.


Yeah, svnX is the best svn ui on the mac at the moment. There is also something called scplugin, which integrated with the finder – icon decal’s for svn status, very handy! – but that project seems to have fallen behind since Tiger came out, I have seen one or two unoffical builds about though if you want to try it, google for it.

You can also look integrating your text editor, BBEdit can have svn integration IIRC, others may too.

And then there are the plethora of contextual menu plugins available for OSX. OnMyCommand is what I’ve used before, it’s not hard to create a commands to do basic svn tasks by control-click (or right click).

But really, you’ll find the command line is really not that hard, follow a tutorial to get your repositories set up and checkout a working copy. Then it’s just svn add, svn remove, svn rename, svn status, svn diff, svn commit etc. It only gets tricky when you start having to do reversions to a particular branch or merging between branches.

Good luck. You’ll love this when you get into it.


If you are about to start with version control you should check out: – this is a replacement to SVN’s client (using SVN’s server), but it adds a lot of additional features; the most minor, but most important of which is that it does not leave .svn folders ALL over the place it also allows you to have a full local copy of the repository (where all the different versions are stored) so that you can do versioning even when your not connected to the server (assuming you have the server on a different machine to the one you are working on).

You may also want to check out – this runs on the same server as your svn server, it intergrates with it and then allows you to use your web browser to view all changes and diffs between changes. It has a nice wiki system which allows you to reference a specific change in the code, and it also has a very simple ticket tracking system, again allowing cross reference to the code and the wiki pages.

Rinke Hoekstra

I juped the SVN bandwagon about two years ago, and ever since I have been using it intensively for programming projects, knowledge representation development and for writing scientific articles (in Tex). Strangely enough the Windows platform has better SVN integration in the TortoiseSVN client (which is integrated in Explorer:

Unfortunately the Mac platform doesn’t have anything as nifty as that, and I was forced to make myself comfortable with using the commandline interface until I recently stumbled upon the freeware ZigVersion ( which offers everything I need. The interface is intuitive and it has a really nice integrated diff view. I believe there are some commercial tools around as well, but they do not offer much more functionality.

Oh, and many IDE’s have SVN integration. I personally use Eclipse and IntelliJ IDEA

Comments are closed.