What is Subversion?
Subversion is an open-source version control system that you will be
using for this class. The main reason we are using subversion is
to submit your assignments, but it also comes in handy when
collaborating with other developers (as you might do if you choose to
work in teams), and provides an easy way to prevent coding
catastrophies (Hard drive crash? Accidentially paste you
literature assignment into a code file and save it? No problem!)
Getting Started
There is complete (and well written) documentation for subversion at http://svnbook.red-bean.com/en/1.4/index.html,
but this page will give you a quick-and-dirty startup guide for this
class. First, we will set up the directory structure for our
repository:
% svn mkdir https://www.cs.usfca.edu/svn/<username>/cs414 -m
"creating directory"
% svn mkdir https://www.cs.usfca.edu/svn/<username>/cs414/trunk
-m "creating directory"
Where <username> is your cs username. Next, we need to
create a "working copy" of the repository locally:
% svn checkout
https://www.cs.usfca.edu/svn/<username>/cs414/trunk cs414
This will create the directory cs414/ in the current
directory. (The local
file doesn't need to be called cs414, you can call that anything you
like. However, please use
https://www.cs.usfca.edu/svn/<username>/cs414/trunk for the
repository name)
Next, create any files that you want to add to your repository, placing
them in the cs414 directory. For instance, we might create the
file MiniParser.java for the first assignment (the file doesn't need to
be complete, it can just be a file containing class MiniParser { } for
now). Once the file has been created, we need to tell the
repository about it. Change to the the local cs414/ directory and
add the file:
% cd cs414
% svn add MiniParser.java
Now subversion knows that you want MiniParser.java in the
repository. However, no changes are made to the repository until
you commit to them. This is done by the commit command:
% svn commit -m "adding MiniParser.java"
Now, if you make any changes to MiniParser.java (or any file in the
repository), you can update the repository with your changes with the
command:
%svn commit -m "<some message about what you changed>"
Every time you add a file locally, be sure to do a "svn add" to let the
repository know about it. Do a commit to add your changes
to the repository. As you make changes to files in the
repository, do commits so that the repository has the most up-to-date
files. This will protect you from losing your work!
If you are working with a friend, and want to get his/her
changes, change to the cs414 directory and type
%svn update
This will update your local working copy based on the repository.
Turning Code In: Branching
When you are happy with what is in the repository, you can create a
branch for us to grade. You can the keep on working on your trunk
line of code, confident that a working "snapshot" of your code has been
branched off. You do this with a svn copy command:
svn copy
https://www.cs.usfca.edu/svn/<username>/cs414/trunk
https://www.cs.usfca.edu/svn/<username>/cs414/MiniParser/ -m
"Branching
for grading"
Viewing Your Code:
If you want to see your code from a different machine than the one you
are working on (or you want to show your code to the TA or myself to
ask questions), all of the files in the repository are available on the
web from:
https://www.cs.usfca.edu/svn/<username>