Recent Changes - Search:

edit SideBar

SubversionOnDepartmentalServer

How to set up Subversion on login.eecs.berkeley.edu

The instructions below are for setting up Subversion to allow one user to safely store revisions of papers and software on a departmental file server that is backed up.

  • Windows: To use Subversion under Windows, you will need to install a Subversion client. TortoiseSVN is a common choice. Windows 7 users may want to use WinCVS instead of TortoiseSVN (details).
  • Mac OS X: Mac OS X users typically have the svn command already installed. However, you may need to update your Subversion client so that it matches the version on the departmental server. For example, in November, 2010, the version on login.eecs was
    bash-3.00$ svn --version
    svn, version 1.6.4 (r38063)
    However, under Mac OS 10.5.8, the default version of svn is 1.4.4:
    bash-3.2$ /usr/bin/svn --version
    svn, version 1.4.4 (r25188)
    Thus, an upgrade is necessary. See Apache Subversion Binary Packages for Mac OS X updates.
  • For more information about getting started with Subversion, see chapter 5 of Version Control with Subversion
  1. Use ssh to connect to login.eecs.berkeley.edu. See the Iris Unix/Services page for information about login.eecs.berkeley.edu
  2. On login.eecs, create the repository by running:
    /usr/sww/bin/svnadmin create ~/repository
    Note that ~/repository is not special, you may use any directory that is writable by your account. Note that if, when you run svn create, you get a message like -bash: svnadmin: command not found, then you need to add /usr/sww/bin to your path on login.eecs. One way to do this is to create a ~/.bashrc file that contains the line:
    export PATH=/usr/sww/bin:${PATH} And then source the file: @@source ~/.bashrc If that does not work, then the problem could be that you are using a different shell, such as csh. If you are using csh, edit ~/.cshrc and add /usr/sww/bin to your PATH.
  3. On login.eecs, determine your home directory by running pwd.
  4. On your local machine, create a test directory. In this example, we create a papers directory that is organized by year and has one paper in it that contains a README.txt file. You could store other information, such as source files for a software project or files for a website.
    Mac OS X or Linux:
    1. Run:
      mkdir -p papers/2010/myPaper
    2. Then add a file:
      echo "A test file" > papers/2010/myPaper/README.txt
    Windows:
    1. Use "Make a New Folder'' to create a papers folder, then go inside papers and create a 2010 folder and then a myPaper folder.
    2. Then right click and select New | Text Document to create the README.txt file.
  5. On your local machine, import the repository:
    Mac OS X or Linux:
    1. Run:
      svn import -m "Initial checkin of papers" papers svn+ssh://login.eecs.berkeley.eduYourHomeDirectory/repository
      where YourHomeDirectory is the directory determined by running pwd above. Usually, the home directory is something like /home/eecs/yourlogin.
    Windows:
    1. Go back up to the directory that contains the papers folder.
    2. Right click on the papers directory and select "TortoiseSVN" and then "import"
    3. In the "URL of Repository" field, enter:
      svn+ssh://login.eecs.berkeley.eduYourHomeDirectory/repository/papers
      where YourHomeDirectory is the directory determined by running pwd above. Usually, the home directory is something like /home/eecs/yourlogin.
      Note that papers must be appended to the URL for Windows.
  6. Test out your repository.
    Mac OS X or Linux:
    1. Change directories to another location: cd /tmp
    2. Get another copy of the repository:
      svn co svn+ssh://login.eecs.berkeley.eduYourHomeDirectory/repository papers
    Windows:
    1. Go to another folder
    2. Right click and select "SVN Checkout"
    3. The "URL of Repository" should be set to:
      svn+ssh://login.eecs.berkeley.eduYourHomeDirectory/repository/papers
    4. Click on "OK"
  7. Make a change to the file.
    Mac OS X or Linux:
    1. Run:
      echo "Another Line" >> papers/2010/myPaper/README.txt
    2. and then commit your change:
      svn commit -m "Added another line to test svn" papers/2010/myPaper/README.txt
    Windows:
    1. Edit the papers\2010\myPaper\README.txt file, make a change and save it
    2. Right click on the README.txt file and select "SVN Commit"

Allowing multiple authors

As of 11/2010, only users with EECS accounts on login.eecs.berkeley.edu may have access to a svn repository created using the above procedure.

To allow access, use Unix groups.

To see what groups you are in, run

-bash-3.00$ groups
labstaff www-dev parlab-all dgc

To see what groups another user is in, run groups userid, where userid is the login of the user on the login.eecs.berkeley.edu machine. For example

-bash-3.00$ groups eal
eal parlab-all parlab-faculty parlab-staff

In the above example, I can see that we have the group parlab-all in common. Grad students should have the grad group in common.

To allow write access to anyone in a group:

cd ~/repository
chgrp -R parlab-all .
chmod -R g+wX .

Note that you might want to create per-project repositories and make only that repository writable. So instead of creating ~/repository, create a directory ~/repositories and then create project-specific svn repositories in that directory, for example ~/repositories/eecs240n.

Edit - History - Print - Recent Changes - Search
Page last modified on April 14, 2011, at 02:13 PM