Using SVN

Subversion FAQ


This FAQ explains how to set up a Subversion repository in your account, how to set up projects, and how to access the repository remotely.

For information about how to use Subversion, please see the documentation at http://subversion.tigris.org. The on-line book available there is very good.


  1. First, you need to add subversion to your path. By default this is already set up for use on Solaris machines. Add the following line to your .cshrc file:First, you need to add subversion to your path. Add the following line to your .cshrc file:
    setenv PATH "${PATH}:/opt/csw/bin"
    After you do this, you should run "source .cshrc" to update your $PATH variable.

  2. Now, you must create a directory to hold your repository. For instance,
    mkdir .svnrepository

  3. Run the following command to create a repository inside the directory you just created.
    svnadmin create .svnrepository
    (NOTE: remember to replace ".svnrepository" with whatever directory name you chose in step 2.)

  4. You now have a repository. There are two ways to create projects: create empty projects, or import preexisting code.

    • To create an empty project, make a directory, such as "my_proj" , to hold your working copy. From outside "my_proj", execute:
      svn import -m "Blah blah" my_proj file://path/to/repository/.svnrepository/trunk
      For instance:
      svn import -m "Some comment" some_dir file:///home/stu10/s16/gjv2098/.svnrepository/trunk
      (NOTE: this command will only work locally. See below for remote access details.)

    • If you have a folder already containing source that you wish to import into the repository, you can execute the above command with the name of the existing directory replacing "my_proj".


  5. In order to remotely access your repository, you must tell subversion to execute through ssh. Let's say you have a project called "my_proj" in your subversion repository and you would like to check it out on a remote machine. Execute the following:
    svn checkout svn+ssh://username@machine.cs.rit.edu/path/to/repository/.svnrepository/trunk my_proj
    The "svn+ssh" portion tells subversion to run through ssh. Replace username with your username and machine with the name of a CS machine (e.g. holly). To find out the path to your home directory, log into a CS machine and execute "pwd". Executing the above command will create a directory called "my_proj" on the remote machine and fill it with the contents of the "my_proj" project.
    In order for svn+ssh to work, you must first execute the following while logged into your account (this need only be done once):
    mkdir ~/bin; ln -s /usr/local/subversion/bin/svnserve ~/bin/svnserve

  6. A final note: Your subversion login credentials are identical to your CS username and password. So, do NOT give these to anyone with the intention of sharing your repository, because you will be giving them access to your ENTIRE ACCOUNT.