Sunteți pe pagina 1din 1

Subversion Components Add Files or Folders Commit Changes to Repository

svn Command line program $ svn add * $ svn commit "/path"


svnversion Revision of working copy Add all items in folder, and recurse Commit changes to file or folder
svnlook Inspect repository (ignores versioned directories) $ svn commit -m "Message" "/path"
svnadmin Repository administration $ svn add itemname Commit with message “Message”
svndumpfilter Filter repository stream If itemname is folder, all subfolders $ svn commit -N "/path"
mod_dav_svn Apache module and files will also be added Commit changes to folder without recurse
svnserve SVN server (SVN protocol) $ svn add * --force
svnsync Mirror repository Force recurse into versioned directories
Miscellaneous Commands ($ svn ... )

resolve "/path" Resolve conflict


Subversion Protocols Deleting, Copying and Moving
cleanup "/path" Recursively remove
file:// Local machine $ svn delete "/path" locks and complete
http:// HTTP (Apache) $ svn -m "Deleting" delete "/path" operations
https:// HTTPS (SSL) Deletes with message “Deleting” lock "/path" Lock path
svn:// SVN (svnserve) $ svn copy "sourcepath" "targetpath" unlock "/path" Unlock path
svn+ssh:// SVN over SSH Copy source to target cat "/path" View file contents
$ svn move "sourcepath" "targetpath" status "/path" Get path status
Move source to target
Subversion Help
Item and Property Statuses
$ svn help
Revert Local (Uncommitted) Changes
$ svn help import '' No modifications
Show help for “import” command $ svn revert "/path/filename" 'A' Addition
Reverts changes to file 'D' Deletion
The $ symbol is used to denote $ svn revert -R "/path/folder" 'M' Modified
Note commands to be typed. Reverts changes to folder recursively 'R' Item replaced
'C' In conflict
'X' Externals definition
Repository Administration Logs and Blame
'I' Ignored
$ svnadmin create "/path/to/repository" $ svn log "/path" '?' Not in repository
Create repository Show log messages from repository '!' Item missing
$ svnadmin setlog "path" -r 7 message.txt $ svn blame "/path" '~' Object type changed
Change log message for revision 7 of Show commits with messages for path
"path" to contents of message.txt
Property Commands ($ svn ... )
$ svnadmin dump "repository" > filename
Differences Between Files
Dump contents of repository to file proplist "/path" List properties
$ svnadmin load "repository" < filename $ svn diff "/path/file" propset PROP VAL Set property “PROP”
Load contents of file into repository See what has changed in "/path/file" "/path" to value “VAL”
$ svn diff "/path/file@2" "/path/file@7" propget PROP "/path" Get value of “PROP”
Compares file in revisions 2 and 7 propedit PROP "/path" Edit “PROP”
Add Local Folder to Repository
$ svn diff -r 2:7 "/path/folder" propdel PROP "/path" Delete “PROP”
$ svn import folder "/path/to/repository" Compared all files in revisions 2 and 7

Argument Shortcuts
Checkout Working Copy Merge Changes
-m "Message" --message
$ svn checkout "/path/to/repository/folder" $ svn merge -r 2:7 "item" "/path/file" -q --quiet
Creates working copy of "folder" Apply the diff between revisions 2 -v --verbose
$ svn checkout "/path" foldername and 7 of "item" to "/path/file" -r --revision
Checkout into new folder "foldername" $ svn merge "url1" "url2" "/path/file" -c --change
Apply the diff between "url1" and -t --transaction
"url2" to "/path/file" -R --recursive
Update Working Copy from Repository
-N --non-recursive
$ svn update "/path"
Note This cheat sheet is based in large
$ svn update -r9 "/path" part on the SVN book, free from:
Update to revision 9
http://svnbook.red-bean.com/ Available free from AddedBytes.com

S-ar putea să vă placă și