How to use Subversion on Oscar

Satya Popuri
Graduate Student
University of Illinois at Chicago.
spopur2 [at] uic [dot] edu
Wed Apr 25 11:42:00 CDT 2007

Follow these simple steps to version control your class projects using subversion on Oscar. You must have subversion and ssh installed on your personal system. These instructions are for linux/Mac systems only.

Create a base SVN repository on Oscar

These commands will create an svn repository in your home directory under a sub directory called 'svn'. 'user' is your userID on oscar. Also note the full path of your home directory on oscar using the pwd command. I have given mine as an example.

> ssh user@oscar.cs.uic.edu

> svnadmin create --fs-type fsfs ./svn

> pwd
mnt_nfs/home3/grad3/spopuri/

Add your class project directory to SVN

Make a project directory on your local system and import it into svn repository on Oscar. Note that I have used the full path of my home directory. Replace it with your own. Also replace 'user' with your user ID on Oscar.
> exit                # log out of oscar
> mkdir cache/        # make the project directory

> svn import cache/ svn+ssh://user@oscar.cs.uic.edu/mnt_nfs/home3/grad3/spopuri/svn/cache/ -m 'Initial import'

Check out from SVN

Now you need to check out the 'working copy' from Oscar. Replace the full path here with yours.

> rm -rf cache/       # remove the local copy

> svn checkout svn+ssh://user@oscar.cs.uic.edu/mnt_nfs/home3/grad3/user/svn/cache/

All set. Have fun.

Now starting hacking on your project inside the directory just checked out. When you add a source file to your project, do:
> svn add sourcefile.cpp
From time to time commit your changes to the repository:
> svn commit -m 'these are the changes in this commit'
There are many things you can do with subversion. Finding the diffs since my last commit is what I find most useful. For this just do
> svn diff
inside your project directory. You can also retrieve old versions and do some other useful tricks (see references below).

Turning in your project

To turn in your project, follow these steps:

> ssh user@oscar.cs.uic.edu         # log on to oscar

> svn export file:///mnt_nfs/home3/grad3/user/svn/cache/       # export a clean directory tree

> turnin -v -ccs485 -pcache cache/

> exit   # log out of oscar.
The export step creates a clean directory with the latest files without any version information (this directory is hence NOT a working copy).

References

Here is an excellent tutorial for svn on Unix systems. This RITES page also contains some information about using remote svn repositories.