Show Menu
Cheatography

Subversion cheat sheet

Subversion Resources

Subversion Components

svn
Command line program
svnversion
Revision of working copy
svnlook
Inspect repository
svnadmin
Repository admini­str­ation
svndum­pfilter
Filter repository stream
mod_da­v_svn
Apache module
svnserve
SVN server (SVN protocol)
svnsync
Mirror repository

Subversion Protocols

file://
Local machine
http://
HTTP (Apache)
https://
HTTPS (SSL)
svn://
SVN (svnserve)
svn+ssh://
SVN over SSH

Subversion Help

$ svn help
$ svn help import
Show help for "­imp­ort­" command
The $ symbol is used to denote commands to be typed.

Subversion Repository Admini­str­ation

$ svnadmin create "­/pa­th/­to/­rep­osi­tor­y"
Create new repository
$ svnadmin setlog "­/pa­th" -r 7 messag­e.txt
Change log message for revision 7 to contents of file messag­e.txt
$ svnadmin dump "­/pa­th/­to/­rep­osi­tor­y" > filename
Dump repository to file (backup)
$ svnadmin load "­/pa­th/­to/­rep­osi­tor­y" < filename
Load repository from file (restore)

Subversion Property Commands

$ svn proplist "­/pa­th"
List properties
$ svn propset PROP VAL "­/pa­th"
Set PROP to VAL for path.
$ svn propget PROP "­/pa­th"
Get value of PROP
$ svn propedit PROP "­/pa­th"
Edit PROP
$ svn propdel PROP "­/pa­th"
Delete PROP
 

Subversion Checkout Working Copy

$ svn checkout "­/pa­th/­to/­rep­osi­tor­y"
Checkout working copy into current folder
$ svn checkout "­/pa­th/­to/­rep­osi­tor­y" "­/pa­th/­to/­fol­der­"
Checkout working copy into target folder

Subversion Update Working Copy

$ svn update "­/pa­th"
Update path
$ svn update -r9 "­/pa­th"
Update path to revision 9

Subversion Add Files and Folders

$ svn add *
Add all items, recurs­ively
$ svn add itemname
Add itemname (if folder, adds recurs­ively)
$ svn add * --force
Force recursion into versioned direct­ories

Subversion Commit Changes

$ svn commit "­/pa­th"
Commit changes to path
$ svn commit -m "­Mes­sag­e" "­/pa­th"
Commit with log message
$ svn commit -N "­/pa­th"
Commit without recursion
$ svn import "­/pa­th/­to/­fol­der­" "­/pa­th"
Import and commit local folder

Subversion Deleting, Copying and Moving

$ svn delete "­/pa­th"
Delete path
$ svn -m "­Delete messag­e" delete "­/pa­th"
Delete with log message
$ svn copy "­/so­urc­e" "­/ta­rge­t"
Copy source to target
$ svn move "­/so­urc­e" "­/ta­rge­t"
Move source to target

Subversion Logs and Blame

$ svn log "­/pa­th"
Show log messages for path
$ svn blame "­/pa­th"
Show commits for path

Subversion Revert Changes

$ svn revert "­/pa­th"
Revert changes to path
$ svn revert -R "­/pa­th"
Revert changes recurs­ively
 

Subversion Differ­ences Between Files

$ svn diff "­/pa­th/­fil­e"
$ svn diff "­/pa­th/­fil­e@2­" "­/pa­th/­fil­e@7­"
$ svn diff -r 2:7 "­/pa­th/­fol­der­"

Subversion Merge Changes

$ svn merge -r2:7 "­ite­m" "­/pa­th"
Apply diff between revisions 2 and 7 of "­ite­m" to path
$ svn merge "­url­1" "­url­2" "­/pa­th"
Apply diff between "­url­1" and "­url­2" to path

Subversion Miscel­laneous Commands

$ svn resolve "­/pa­th"
Resolve conflict
$ svn cleanup "­/pa­th"
Remove locks and complete operations
$ svn lock "­/pa­th"
Lock path
$ svn unlock "­/pa­th"
Unlock path
$ svn status "­/pa­th"
Get path status
$ svn cat "­/pa­th"
View file contents

Subversion Item and Property Statuses

 
No modifi­cations (blank)
A
Addition
D
Deletion
M
Modified
R
Item replaced
C
In conflict
X
Externals definition
I
Ignored
?
Not in repository
!
Item missing
~
Object type changed

Subversion Argument Shortcuts

-m "­Mes­sag­e"
--message
-q
--quiet
-v
--verbose
-r
--revision
-c
--change
-t
--tran­saction
-R
--recu­rsive
-N
--non-­rec­ursive
                               
 

Comments

Is this valid for Subversion 1.7.x?

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Mercurial (Hg) Cheat Sheet
          Bazaar version control system Cheat Sheet

          More Cheat Sheets by DaveChild

          Regular Expressions Cheat Sheet
          Linux Command Line Cheat Sheet
          CSS2 Cheat Sheet