Table of Contents

Subversion

:!: We are no longer actively supporting Subversion.

Project Manipulation

Project Directory Structure

Organize your code to import into the following structure:

myproject/
myproject/branches/
myproject/tags/
myproject/trunk/
myproject/trunk/dir1/
myproject/trunk/file1
...

Importing/ Creating a Project

Assuming the project directory is a subdirectory of the current directory, you would enter the following command:

svn import project file:///path/to/repository/newproj_name -m "First Import"

e.g.,

svn import Logic file:///home/courses/cs297/shared/svn/Logic -m "First Import"

Checking Out a Project

svn checkout file:///repository_name/project/trunk project

Adding Files or Directories

svn add file_or_dir_name

Deleting Files or Directories

svn delete file_or_dir_name

Committing Changes

 svn commit

Updating Files

svn update
Code Meaning
A Added
D Deleted
U Updated
C Conflict
G Merged

Tagging a Version

To give a version of the project a name, use svn copy

svn copy file:///path/to/repos/project/trunk \
         file:///path/to/repos/project/tags/release-1.0 \
    -m "Tagging the 1.0 release of the project."

Conflicts

Conflicts can be detected with the update command. When Subversion detects a conflict in a file, it places conflict markers into the file (to allow the user to find the places of the conflict) and creates the following three files in the directory:

The file without the conflict markers

The file as it was before I started to change it.

The HEAD revision of the file

Resolving conflicts Conflicts can be resolved by doing one of the following three things:

Creating a Repository

svnadmin create /path/to/repos

The actual repository/directory should not have been created yet. This command will handle that for you.

Using ssh with svn

Use the svn+ssh:// URL schema to connect.

Example:

svn list svn+ssh://host.example.com/repos/project
harry@host.example.com's password:

Subclipse with Eclipse

Subclipse is a plugin for Eclipse that allows users to easily use Subversion with their code.

Installation

After Installing

Set Up Repository

Team Menu

The Team menu is where you'll find the commands you need to work with the subversion repository.

Subclipse with Eclipse on Windows

SVN GUI Clients

Of course, you may not want to use the command-line.