joshbuhler.com

Setting up the Subversion Client on Mac OS X

by Josh on Jul.05, 2005, under Development, Mac

These instructions will guide you through the process of installing and using the Subversion Client on OS X. Later I’ll do a post on how to setup your own SVN repositories, but for now it’s just how to setup the client to access repositories. The initial setup takes some time, (approx. 20-30 minutes), and you will need to use the Terminal, so pay attention, and we’ll get through this together.
Files Needed

To begin, download the following files:

  • Subversion Client - This is the client software used to connect to the server. It’s command-line only. The current version as of this writing is 1.2 - You can download an installer from http://metissian.com/projects/macosx/subversion/
  • SCPlugin - Enables integration with the OS X Finder, adding Subversion commands to the Finder context menu.
  • svnX - A GUI application that allows browsing of SVN repositories, importing of new projects, checkouts of repositories, etc. The current version available as of this writing is 0.9.5.

Installation

Installation has three main steps. The first “The Subversion Client” is required, but the last two are optional. However, they make using SVN much easier.

The Subversion Client

  1. Begin by installing the SVN client first. Mount subversion-client-1.2.0.dmg (or whatever version you downloaded), and run the installer package inside. Follow the instructions, and when the install is complete, open Terminal (located in Utilities > Terminal).
  2. We’ll be using Terminal to verify that Subversion was installed correctly. We’re also going to make SVN easier to access from the command line, to save you some typing in the future is you decide to use SVN that way. To do so, you’ll need to edit your .bash_profile file. This tells the bash shell where to look for Subversion. In this guide, we’ll be using Pico to edit the file. At the command prompt, enter pico .bash_profile

  3. Add the following lines to the file: PATH="/usr/local/bin:/usr/local/subversion/bin:$PATH"
    export PATH
  4. Save the file (control-O in Pico)
  5. Restart Terminal.
  6. You should now be able to enter svn at the command prompt, and receive the following output: “Type 'svn help' for usage.” This means that SVN is now installed and ready for you to use via the command-line.

Subversion is fully-functional and can be used only from the command line if you like. I recommend that you spend some time becoming familiar with the command line interface. Some commands can only be issued using the command-line, and you will be able to get a better understanding of how SVN functions. Also, the Subversion tools for Mac are nice, but since the ones used here are still under development, some features are still missing.

Installing SCPlugin

  1. Follow the installation instructions here: http://scplugin.tigris.org/installation.html

Installing svnX

  1. Mount svnx.dmg, and drag svnX.app to your Applications folder, or wherever you would like it.
  2. Open svnX, and open the Preferences panel. Enter the path to your Subversion binaries folder (/usr/local/bin) in the text field, and close the Preferences panel.
  3. svnX opens with two windows, “Repositories” and “Working Copies”. You’ll need to add a new link to the repository you want to access. Create it by clicking the “+” button in the Repositories window. Give the new link a name, enter the url of the repository, and the username & password given to you for the respository by the system administrator.

    Double-click the new link in the list to access the repository. svnX stores your password in clear text, so after you login, erase your password if you do not want it visible. Subversion stores your login information in a cache file elsewhere on your system, so you will not have to enter it each time. You can specify that Subversion does not cache your login information, however this option is only available via the command-line.

You should now be ready to begin using Subversion on your Mac. For additional information on using Subversion and it’s various commands, please consult the documentation available in the Subversion Book

References:

Update: - SC Plugin has at times some issues refreshing the icons in a working copy to correctly show their status. Check out the next entry titled Nudge Your Files In OS X for info on Nudge, a free utility that can help correct this.

As with all my tutorials and other assorted ramblings, I’d love to hear your comments, questions, whatever. Also, if you find a typo or error, let me know so I can fix it.


The following link has nothing to do with SVN, other than it’s the version control software we use at Footnote.com. This is a link to a topic page there that I’ve created about the construction of Disneyland. The link is for a little experiment we have going on how well these links work, and if search engines will pick them up.



:, , , , ,
36 comments for this entry:
  1. glitch

    Dude, you friggin rock!! Awesome post. It’s guys like you that remind why I do this work.

  2. paul

    Hi,

    !!!! Great post, well documented.

    Only question is, where is you subversion server, do you have one on you local machine, if so how do you install a subversion server on OSX?

    Thanks

  3. seth

    great, quick tutorial Josh.

    Do you use/have you setup svn inside xcode?

  4. Jim

    Josh, this was one of the best setup tutorials I’ve seen. Each step worked perfectly, now I’m rocking the subversion on my powerbook. thanks :)
    Jim

  5. Rasmus

    The client version is not on that site - where can I get it?
    Thank you.

  6. roym

    So I understand it that you are runnung the server side of subversion on your local machine - is that correct? Does it use up much cpu time when not in active use, and does it use up much space?

    Thanks,

    -Roy M.

  7. talazem

    Thanks for the walk-through — I tried several others, and this one is the only one that got it all up and running.

    I am not a programmer, but an academic who would like to use version control on my writings. As such, I want to store my work on my local computer (the laptop I use). You mentioned above that you might put out a tutorial on this… as a non-programmer who can only use command-line in a monkey-see monkey-do action, I would really appreciate this myself, and am sure that others would as well.

    Thanks again.

  8. Bakki Kudva

    I am getting the following errors. Any idea what this is?
    subversion/libsvn_wc/log.c:338: (apr_err=155009)
    svn: In directory ’sr’
    subversion/libsvn_subr/io.c:565: (apr_err=2)
    svn: Can’t copy ’sr/.svn/tmp/text-base/README.svn-base’ to ’sr/README.tmp’: No such file or directory

    I am thinking of installing subversion from Darwinports. Any tips on uninstalling the client? Do I need to do it manually by reading the file list from the readme file? If so I am a bit unclear on how to delete the files in lib directories. I am new to OSX. Do I need to ldconfig after delete?

    Thanks for any help you can give me.

  9. Dennis

    Great tutorial and I got it running. One question though: What’s the URL I need to enter at ‘Installing svnX - step 3′? I tried serveral things like: svn://localhost/Users/dburger/Sites/css_examples/freakin_cool.

    I’d like to use svnX to do webdesigns and PHP from my ~/Sites folder. But when I try the above URL I get an error (even with my accounts username and password set) saying it can’t connect: username or password incorrect. But I’ve seen some URL’s like: svn://subdomain.website.org/svn etc. I’m not running a server that has a domain name or anything like it. It’s just a local Mac in a network.

  10. Josh

    First, you need to have a repository setup locally, with svnserve running. Once you do that, your url would be something like: svn://localhost/repoName.

    This tutorial doesn’t cover setting up the SVN server on your Mac, only the client. You can do it, however, I just haven’t had the time to write up any instructions yet.

  11. Dennis

    I’ve got it working now. I used the terminal svnadmin and create commands to import my project to Subversion. But I can’t find any way to do this using svnX. Drag and Drop doesn’t work. svnX can’t import anything. It’s a little time consuming to import project using the terminal commands. Anyway svnX can do this?

    After reading the ‘SVN book’ I’m beginning to understand how Subversion and revisions work. Great tool and good tutorial! Keep up the good work. Kind regards from the Netherlands.

  12. Rolando

    Permission denied, please try again.

    Permission denied, please try again.

    Permission denied (publickey,gssapi-with-mic,password).

    subversion/libsvn_client/commit.c:873: (apr_err=210002)
    svn: Commit failed (details follow):
    subversion/libsvn_ra_svn/marshal.c:255: (apr_err=210002)
    svn: Connection closed unexpectedly

    Process finished with exit status 1.

  13. Bobby

    I keep trying to install the SCPlugin on my Macbook Pro, the installer prompts me to “upgrade”, then after restrating the Finder, when clicking the SCPlugin in system preferences, I get this error:

    “You cannot open SCPlugin preferences pane on this computer. Contact the developer of this software for a newer version.”

    I’ve been wracking my brains over this one for the past couple of days, do you have any idea how I can get it to work? Subversion and svnx work fine, I have set up repos locally, and do versioning. I just want the convenience of using the Finder for Subvesion. Any help will be greatly appreciated!

  14. Bobby

    After surfing some more, I found out I had to have the MacIntel version of the SCPlugin. Already tried these to no avail:

    http://www.nabble.com/SCPlugin-on-MacIntel-t1768829.html
    http://studiofunk.com.au/downloads/SCPlugin-Intel.zip

  15. Josh

    I’m not sure if this plugin is available as a Universal Binary yet. To be honest, I haven’t been using it for a while now, and I’ve never tried it on an Intel-based Mac. You may want to try contacting the author of the plugin about getting it to work on you MacBook.

  16. Rusty

    Josh:
    Just a short note of thanks for this excellent tutorial. I am new to subversion, and this was exactly what I needed to get me over the hump. Thanks again for the time and effort.

  17. Noel

    Thank you Josh. I tried several times to come in contact with sbv but never got it right. But this easy to understand Tutorial helped realy.

  18. Michael Henn

    Thank you so much for this. It gave me that last little bit of info that I could not find anywhere else!

  19. Sanna

    well, I made all fine so far until this:
    Now, right click on any folder to start “Subversion > Checkout”.
    -> when I do this and add the url of one sourceforge project I, it asks me username and password and then it comes only a blank screen… nothing really happens.

  20. Sanna

    I tried this SvnX as well and that on the other hand complains that the certificate of sourceforge is not trusted and thus can’t proceed.
    Looks like too complicated thing to do this SVN…

  21. Antonio

    Awesome tutorial. How can I make it work with svn+ssh://xxx I’ve tried and failed many times and really need access to this repository. I have the right credentials since I can use ssh directly and login remotely to the site… but never through svnx. Help.

  22. richard

    Hi there. I installed svn folowing instructions on another site, and i didn’t know what I was doing. I think it was working but then I did something (don’t know what) and broke it. Now I’m trying to use your instruction (which make sence to me), but something is not working.

    When I do the “pico” comand it launches GNU nano 1.2.4

    then after the rest of the svn instal when I relaunch the terminal and enter svn in the terminal I get the following error:

    -bash: svn: command not found

    How can I uninstall and start over, or fix this.

  23. keith

    ive gone through this whole process twice but keep getting errors after logging in.

    apr_err=170001

    anyone had this occur? it is amid 2 paragraphs of error description i cant decipher

  24. pete

    Thank you for this great tutorial. I got all the way to the part when I double click the URL but then I get the following error message :
    subversion/libsvn_ra_local/ra_plugin.c:285: (apr_err=180001)
    svn: Unable to open an ra_local session to URL
    subversion/libsvn_ra_local/split_url.c:125: (apr_err=180001)
    svn: Unable to open repository ‘file:///Users/multi/Documents/Development’

    : (apr_err=180001)
    svn: Unable to open an ra_local session to URL
    subversion/libsvn_ra_local/split_url.c:125: (apr_err=180001)
    svn: Unable to open repository ‘file:///Users/multi/Documents/Development’

    Tried a number of things but no luck. Any ideas?

    thanks :)

  25. xtfer

    Thanks for this, i finally have SVN working in a fashion i can understand, rather than command line which always flummoxed me. Thanks very much.

  26. jackr

    The directions on installing SCPlugin are out of date (they’re for version 0.5, we have released 0.6). We’ve made progress on a massive rewrite, with a lot of cool benefits. We do not yet have an installer, but we do have a download (in the place you already link). The new version does not need the System Preferences panel, nor the external Framework; it’s all self-contained in the one bundle.

    No installer, yet, but all you need to do is drag the bundle into

    /Library/Contextual Menu Items/

  27. P.J. Onori

    This article just made my life oh-so-better. Thanks so much for taking the time to post it. :)

  28. Josh

    @jackr - I’ve been noticing that there is actual traffic on the mailing lists now - that’s great. The latest build of SCPlugin is great as well. A BIG improvement. I’ve udpated the post accordingly.

  29. xiaosa

    I’m install success by myself,
    hm, but the same question : how can i uninstall the “Subversion Client on OS X” ?

    just delete the files from package list?

  30. Jinsy

    Hi the tutorial works great. I have it up and running. However I ran into a commit issue - Each time I try to commit, I get an error subversion/libsvn_client/commit.c:873:
    (apr_err=170001)
    svn:Commit failed (details follow):
    subversion/libsvn_client/client.c:309:
    (apr_err=170001)
    svn: Can’t get password.
    Any help would be appreciated.

  31. bz029

    FYI if your on Mac OS X (im on 10.3.9) and using svn+ssh then it won’t read the .bash_profile on the server side. I had to put info into .bashrc instead….

  32. bigbob

    I would like to know where the .bash_profile file is located.

  33. bigbob

    nevermind, I fixed it. good post by the way

  34. Mike V

    In the Finder, under the Go->Connect to Server menu, you can type in the url to your svn depot and it will mount as a volume on the Desktop. You don’t get all the features of a rich svn client, but … how cool is that!

  35. Ben

    Many thanx Josh. I am a long time Windows user that has been hooked on TortoiseSVN for years but now that I got the client working on my mac this will help wean me off the PC.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...