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
- Use ssh to connect to
login.eecs.berkeley.edu. See the Iris Unix/Services page for information about login.eecs.berkeley.edu
- 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.
- On
login.eecs, determine your home directory by running pwd.
- 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:
- Run:
mkdir -p papers/2010/myPaper
- Then add a file:
echo "A test file" > papers/2010/myPaper/README.txt
Windows:
- Use "Make a New Folder'' to create a
papers folder, then go inside papers and create a 2010 folder and then a myPaper folder.
- Then right click and select New | Text Document to create the
README.txt file.
- On your local machine, import the repository:
Mac OS X or Linux:
- 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:
- Go back up to the directory that contains the
papers folder.
- Right click on the
papers directory and select "TortoiseSVN" and then "import"
- 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.
- Test out your repository.
Mac OS X or Linux:
- Change directories to another location:
cd /tmp
- Get another copy of the repository:
svn co svn+ssh://login.eecs.berkeley.eduYourHomeDirectory/repository papers
Windows:
- Go to another folder
- Right click and select "SVN Checkout"
- The "URL of Repository" should be set to:
svn+ssh://login.eecs.berkeley.eduYourHomeDirectory/repository/papers
- Click on "OK"
- Make a change to the file.
Mac OS X or Linux:
- Run:
echo "Another Line" >> papers/2010/myPaper/README.txt
- and then commit your change:
svn commit -m "Added another line to test svn" papers/2010/myPaper/README.txt
Windows:
- Edit the
papers\2010\myPaper\README.txt file, make a change and save it
- 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.