Show Menu

Subversion Cheat Sheet by DaveChild

Subversion cheat sheet

Subversion Components

svnCommand line program
svnversionRevision of working copy
svnlookInspect repository
svnadminRepository admini­str­ation
svndum­pfilterFilter repository stream
mod_da­v_svnApache module
svnserveSVN server (SVN protocol)
svnsyncMirror 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"
$ 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)
RItem replaced
CIn conflict
XExternals definition
?Not in repository
!Item missing
~Object type changed

Subversion Argument Shortcuts

-m "­Mes­sag­e"--message

Share This Cheat Sheet!

Favourited by 13 Members:

relizont Theosis akipta avalitan petraeus ncapponi simspace dttk gorillawit DaveChild sebbu mishin Wbbourne


Luke Mackenzie Luke Mackenzie, 12:10 21 Aug 12

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.