Skip Navigation

Subversion Cheat Sheet

Overview

mod_rewrite Cheat Sheet Version 2 The Subversion (SVN) cheat sheet is a one-page reference sheet for Subversion on the command line.

If you like the cheat sheets, and want to say thanks, please consider buying me something from my Amazon Wishlist. Thankyou very much to those who have already hunted it down and sent me something - I'm very grateful!

Much of the content on this cheat sheet is based on the excellent SVN Book, available at http://svnbook.red-bean.com/. This is the first cheat sheet created with the involvement of the Cheat Sheets Google Group. Many thanks to Alan Switzer and Randy Merrill for their suggestions and feedback. Finally, thanks also to the 210 people who requested this cheat sheet!

Downloads

The Subversion Cheat Sheet is released under a Creative Commons License (Attribution, Non-Commercial, Share Alike).

Please note: If you wish to link to a cheat sheet from elsewhere, please link to this page so others find all available versions, the license and the description.

Subversion Components

Thumbnail highlighting Subversion Components. Subversion is made up of several different parts. In addition to the svn command line program most people are familiar with, there are also utilities like svnlook and svnadmin, a server (svnserve) and an apache module.

Subversion Protocols

Thumbnail highlighting Subversion Protocols. Subversion clients can connect to subversion servers over a variety of different protocols, including HTTP and SSH.

Subversion Help

Thumbnail highlighting Subversion Help. If you ever find yourself stuck, of unsure of how a command works (and this cheat sheet is unable to help), check out "svn help" for general Subversion help, or "svn help command" for help with a specific command. Please note that command line commands will be marked with "$" on this cheat sheet. Explanations will be on the following line and italicized.

Repository Administration

Thumbnail highlighting Repository Administration. This section of the cheat sheet shows some of the basic, and most commonly used, repository commands, starting with how to create a new repository.

Getting Started

Thumbnail highlighting Getting Started section. The first thing you are likely to want to do with a brand new repository is add some files to it. For this, you will need the import command. If you want to create a local copy (usually referred to as a working copy) of a repository, you will need to checkout. And if you want to grab any changes to the repository, you will need to run an update.

Adding, Deleting, Copying and Moving

Thumbnail highlighting Adding, Deleting, Copying and Moving. These sections of the cheat sheet outline basic file and folder operations: Adding, Deleting, Copying and Moving.

Revert Changes

Thumbnail highlighting Revert Changes section. If you want to undo changes you have made to your working copy (i.e., change it back to the way it was when you last updated it), you can revert changes.

Logs and Blame

Thumbnail highlighting Logs and Blame. Log files are what make version control systems useful, giving you a complete history of changes to a repository. The log command will show you all the changes to a path, and the blame command will show you the changes to a path with more specific information.

Diffs and Merges

Thumbnail highlighting Diffs and Merges. The diff command shows you the difference between two files, while the merge command allows you to apply the diff between two files to a third one.

Commit

Thumbnail highlighting Commit section. Commit is the command you will use most often when working with SVN, by far. It is the command you run when you want to send what you've changed back to the repository. You should always add a message with your commit, explaining the changes you are making.

Miscellaneous Commands

Thumbnail highlighting Miscellaneous Commands. This section of the cheat sheet lists some of the lesser used Subversion commands, including cleanup - a command to resursively remove locks and complete unfinished operations (very useful when things go wrong) and resolve (when you are working on a file, but another developer has changed the file at the same time, you will have a conflict - this command is to be used when the conflict has been resolved).

Item and Property Statuses

Thumbnail highlighting Item and Property Statuses. If you run the status command on a path, you will see a list of letters (and blank spaces) for each item in the path. Each of these letters has a specific meaning and tells you something about the file you are viewing. This section lists those letters and their meanings.

Property Commands

Thumbnail highlighting Property Commands. Items in a Subversion repository have properties specific to SVN, and these properties can be added to, edited or deleted. This section lists the commands you will need in order to be able to work with properties.

Argument Shortcuts

Thumbnail highlighting Argument Shortcuts. Finally, almost every Subversion command takes a selection of arguments, and many of these have shortcuts. If you want to commit changes to a folder, but don't want to commit changes to its contents, you could type svn commit --non-recursive "/path", but it's much quicker just to use the shortcut -N instead of --non-recursive.

9 comments

It might make more sense for the PNG version to be a simple link instead of a "force this to be a download" page?

I just want it to open in Firefox, not prompt for programs to use.
Adam: I'm not certain I'm going to keep the download setup as it is now - I might well revert it to the old system where you could view online. The problem with that was that most people were bookmarking the sheets to view online rather than saving them and/or printing them - then when I started having server trouble they couldn't access them at all.

I'm working on improving my hosting setup so this might not be a problem in future, and I'm happy to change it back (or even just present more options for downloading or viewing online) if that's what people want.
masklinn
France #3: August 7, 2008
Dave, maybe you should specify somewhere that your cheat sheet is for svn 1.4, as 1.5's been recently released and has quite a few supplementary features
masklinn: I was aiming for the cheat sheet to be usable for 1.5 - is there something there that won't work with 1.5?
@Dave: Good point about bandwidth... maybe posting on Google Code and linking to it over there might help?
masklinn
France #6: August 8, 2008
Dave, absolutely not, as far as I know the svn 1.5 interface is completely backwards compatible with 1.4, it's just that 1.5 has a few interesting goodies (e.g. a shortcut for svn log's "--limit", the beginnings of merge tracking, ...)
 Grand Rapids, MI, USA #7: August 15, 2008
Hi, Dave!

Just a quick note: you have a typo in paragraph #2; Thank you runs together as Thankyou...

Feel free to erase this comment if you fix the typo!

:D
I guess cheat sheets are something that will always come in handy, some things never change, and anything to help the cause is a good thing. Thanks for the info.
Respectfully,
Dr Saxe
 San Luis Obispo, CA #9: September 16, 2008
If you're concerned about hosting issues, I'd recommend using Scribd.com for hosting your PDFs and any other documents. They have a wonderful way to see most documents online and also allow downloads.

Post Your Comment

· Comments with keywords instead of a name have their URLs removed.
· Your email address will not be displayed or shared.

Live Comment Preview

 United States #10: 1 minute ago