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 […]

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?

You’re subscribed! If you like, you can update your settings

  1. Rinke Hoekstra Thursday, July 27, 2006

    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: http://tortoisesvn.tigris.org).

    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 (http://zigversion.com) 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

  2. If you are about to start with version control you should check out:

    http://svk.elixus.org/ – 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 http://trac.edgewall.org/ – 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.

  3. 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.

  4. Rinke Hoekstra Friday, July 28, 2006

    … and Quicksilver has a Subversion plugin as wel …

  5. I would also recommend SvnX (http://www.lachoseinteractive.net/en/community/subversion/svnx).It is simple to use and automatically detects the files to be submitted.

  6. 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.

  7. SmartSVN (http://www.syntevo.com/smartsvn/index.jsp) is a great java-based SVN client that has a free foundation version.

  8. 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.

  9. 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

Comments have been disabled for this post