Skip to content

Subversion on Mac - quick setup

I did this on Mac OS 10.5. It comes with both svn and svnserve installed. Should probably work for prior OSs as well.

  1. Create a regular user (no admin privileges), I suggest you call it svn.
  2. Open a terminal window and log in as this user:
    su svn
  3. Create a new directory and call it repositories, or something else of your choice, under the home directory (which is probably):
    mkdir /Users/svn/repositories
  4. Set up a subversion repository for a new project, name it for example project1:
    svnadmin create /Users/svn/repositories/project1
  5. Change into the project1/conf subdirectory and edit svnserve.conf according to your needs. The minimalist changes will probably be something like uncommenting/changing the following lines:
    [general]
    anon-acccess=none
    auth-access=write
  6. If others need access, who are not users of the system or you want to use a different username for yourself also uncomment:
    password-db=passwd
  7. Then also edit the passwd file in the same project1/conf subdirectory.
  8. If you want to adhere to the tradition create trunk, branch, tags subfolders under project1. If you prefer to make up your own directory names and structure feel free to do so.
  9. Start the server as a demon with:
    svnserve -d -r /Users/svn/repositories
    (default port is 3690)
  10. Connect remotely from another machine and add some new, not yet versioned material ((this command is all on one line):
    svn import /path/to/mylocal_project_folder svn://[hostname_or_IP]/project1/trunk
    If the environment variable is not set and you receive an error to set your editor:
    export SVN_EDITOR=vi (or emacs or...)
  11. Now check what you uploaded:
    svn list svn://[hostname_or_IP]/project1/trunk

To stop the server for any reason:
ps ux | grep svnserve
The second number is the process number
kill [that number]

The complete svn documentation: http://svnbook.red-bean.com/

No TweetBacks yet. (Be the first to Tweet this post)

Categories: Research Tools.

Tags: ,

Comment Feed

One Response

  1. Thanks for posting this Mac friendly download tutorial- there are a ton for Windows subversion downloads, but the ones that are for Mac are hard to understand. This was great!



Some HTML is OK

or, reply to this post via trackback.