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!
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 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 clients can connect to subversion servers over a variety of different protocols, including HTTP and SSH.
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.
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.
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
These sections of the cheat sheet outline basic file and folder operations: Adding, Deleting, Copying and Moving.
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
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
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 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.
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
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.
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.
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.
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!