LAST EDIT: Wednesday, June 4th, 2008

Subversion Cheat Sheet

A list of common Subversion terminal commands and examples. Note, more information about all of these commands can be obtained by using "—help" argument:

svn command --help

Project/Directory Structure

When creating a project, the Subversion documentation suggests that you create a directory structure like the following:

Project
   |
   |-->branches
   |
   |-->tags
   |
   |-->trunk
         |
         |-->directory01
         |       |
         |       |-->file01
         |       |
         |       |-->file02
         |
         |-->directory02

Import

Used for importing a new project into a repository:

svn import /path/to/project http://svn.example.com/project -m "First Import"

Checkout

Check out a project into your local working directory:

svn checkout http://svn.example.com/project/trunk /path/to/working/directory 

List Projects

To get a list of the current projects stored in a repository, you can use the following command.

svn list --verbose http://svn.example.com/project/

Update

To bring a local project up to date with the repository, issue the following command from within the working project directory:

svn update

Status

To list status of project/modified files, issue the following command from within the working project directory:

svn status

Commit

To commit your changes to the repository, issue the following command from within the working project directory:

svn commit -m "short log message detailing changes made"

Add

New files/directories need to be added to the project, issue the following command from within the working project directory:

svn add path/to/new_file_or_directory

Delete

To delete files/directories that are no longer required, issue the following command from within the working project directory:

svn delete path/to/new_file_or_directory

Tagging Projects

To create a project release, create a new tag to identify the project. This is done by making a virtual copy of a project in the tags directory. For example:

svn copy http://svn.example.com/project/trunk http://svn.example.com/project/tags/0.0.1 -m "Tagging the 0.0.1 release" 

External Links:


Add Your Comment

Use the form below to add your comment. Markdown syntax is available. Note, comments are moderated by me for spam filtering. Alternatively, feel free to contact me privately.