This tutorial assumes the user is running Mac OS X, which comes with Subversion installed. Presumably the technique described here is easily modified to work on other operating systems.
You can create the repository anywhere in your home directory. For the examples in this tutorial, the Subversion repository is:
/afs/cs.stanford.edu/u/mbostock/svnObviously, you'll want to substitute "mbostock" for your own username. The repository is created using svnadmin on xenon:
cd ~ svnadmin create svnThe svn directory that is created should be considered private (as in, an implementation detail of the source control system); you should not edit any of the contained files manually, because you will be using Subversion to manage them.
Most likely, you'll want your repository to be private from a file-sharing perspective as well, so be sure to set the permissions appropriately using chmod. If you want to share a repository with other users (for example on a group project), you can always create another repository with shared access.
cd ~/Documents svn import foo -m "Initial import" \ svn+ssh://xenon.stanford.edu/afs/cs/u/mbostock/svn/fooNote that the local directory structure and the repository directory structure don't have to match, though for sanity's sake it's a good idea for them to be similar. You can map a local directory to any directory in the source repository; you can even have multiple checked-out versions of projects if you wanted to. But for now, keep things simple by using the same hierarchy.
If you weren't careful, it's likely that some additional cruft was included in the initial import, like generated Java class files or emacs backup files. Don't worry; you can always delete these in a subsequent revision.
mv foo foo-old svn checkout svn+ssh://xenon.stanford.edu/afs/cs/u/mbostock/svn/fooHooray! You can now make edits within source control. And fortunately, this is the last time you'll need to type out the full path to the repository over SSH; once you've checked out a working copy, Subversion internally keeps track of the corresponding repository's location.
Note that by default you will need to enter your password to run most svn commands. However, if you first run kinit to establish Kerberos credentials, you won't be repeatedly prompted for your password. (See How To Setup Kerberos if you have difficulty running kinit.)
svn checkin -m "Some new changes"If you omit the -m parameter, svn will pop up your editor so that you can enter a longer description of the changes.
svn cat Foo.java@1 > Foo.java svn ci -m "Reverting Foo.java to @1"You can similarly use this technique to restore deleted files.
svn add Bar.java svn ci -m "Adding Bar.java"Similarly, if you remove a file using rm, that file will not be removed from the repository during your next submit. In fact, the removed file will be restored if you run svn update. To delete the file locally and from the repository, use svn delete instead:
svn delete Bar.java svn ci -m "Deleting Bar.java"