Version Control and Program Submission

Essential Subversion Commands

Complete information about Subversion can be found in the book Version Control with Subversion. In addition, there is a nice small one-page quick reference card.

Here are a few of the essential commands:

svn checkout http://www.sdml.info/svn/oop/username Checks out a working copy from the repository.

svn add filename Puts the file filename under control of the versioning system.

svn commit -m "comment" Commits the changes that you have made to the working copy to the repository.

svn update Brings your working copy up-to-date with the repository. Any changes made in the repository are put into your working copy. Useful when the instructor or grader creates/updates files.

svn mv oldfilename newfilename Changes the name of a file from oldfilename to oldfilename. Only occurs in the working copy, i.e., must be committed to show up in the repository.

svn delete filename Deletes the file filename. Only occurs in the working copy, i.e., must be committed to show up in the repository.

svn mkdir directory_filename Creates a new directory with the name directory_filename. Only occurs in the working copy, i.e., must be committed to show up in the repository.

svn mv old_directory new_directory Changes the name of the directory with the name old_directory to the new name old_directory. Make sure to commit any work that you have and perform an update first to avoid any problems. Only occurs in the working copy, i.e., must be committed to show up in the repository.

svn log filename Presents information about the various versions of filename. Can be used to find the version number that corresponds to a version that you may want (based on the annotation given when committed).

svn propset svn:mime-type text/html filename.html Sets the mime-type property of filename.html to text/html. This makes the repository web server send the page with the proper mime-type for a web page. Only occurs in the working copy, i.e., must be committed to show up in the repository.

svn proplist filename.html Shows the current properties set for filename.html. This is useful to see what was previously set by the svn propset command.