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)

One thought on “Subversion on Mac - quick setup

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>