Subversion

From CSE330 Wiki
Jump to navigationJump to search

Subversion (svn) provides an easy way to store all of your files that you create in this course on a server backed up at WashU. It also allows you to easily create and edit text files on your local computer and then transfer them to the Amazon cloud machine using the svn "checkout" command.

Setting Up SVN on your Server

First, install the package using yum. For more information on installing packages, refer to the Linux guide. The package name is svn in yum and subversion in apt.

Next, navigate to your home directory and checkout your repository:

$ cd
$ svn co https://hostname.wustl.edu/path/to/repository
...
$

You will need to authenticate using your WUSTL key username and password (not your CEC or EC2 password). The path to this semester's repository is listed on Module 1.

After running the above commands, an empty directory should be created. To make sure that SVN is working, cd into the directory, create a text file, and tell SVN to start version control on it. Finally, commit the file to the remote repository:

$ cd Lastname-studentid
$ touch helloFromTheCloud.txt
$ svn add helloFromTheCloud.txt
A         helloFromTheCloud.txt
$ svn commit -m 'Added first file'
...
Committed revision 1.
$

Pointing Apache to your Repository

You may find it helpful to have Apache serve files from a certain directory inside your repository to which you can commit changes from your desktop. We can do so using a symbolic link (similar to a "Shortcut" in Windows or an "Alias" in Macintosh). Move public_html (or .html if you remapped UserDir) into your repository, and link to the new location from the old location:

$ cd   # Make sure that we're in the right directory
$ mv public_html Lastname-studentid/htdocs   # change public_html to .html if you remapped UserDir
$ ln -s Lastname-studentid/htdocs public_html   # change public_html to .html if you remapped UserDir
$

Now, all files you save inside the htdocs directory in your repository will be served by Apache via the UserDir module.

Setting Up SVN on your Desktop

If you've taken CSE 131 or 132, you should already have SVN installed in Eclipse. If not, refer to the tutorial here: http://www.cs.wustl.edu/~cytron/cse131/HelpDocs/Subversive/subversive.htm

When you're ready, check out the repository into Eclipse. The path to this semester's repository is listed on Module 1.

Do you see the helloFromTheCloud.txt file that you made earlier? (You should.)

Create another text file, helloFromMyDesktop.txt. Commit that file to the remote repository

Back on your server, issue svn update. The helloFromMyDesktop.txt should be downloaded:

$ svn update
A    HelloFromDemo.txt
Updated to revision 89.
$

SVN Resources