.\" You can view this file with: .\" nroff -man [filename] .\" .TH svn 1 "9 Sept 2002" "svn r3146" "Subversion Command Line Tool" .SH NAME svn \- Subversion command line tool .SH SYNOPSIS .TP \fBsvn\fP \fIcommand\fP [\fIoptions\fP] [\fIargs\fP] .SH OVERVIEW Subversion is a version control system, which allows you to keep old versions of files (usually source code), keep a log of who, when, and why changes occurred, etc., like CVS, RCS or SCCS. \fBSubversion\fP keeps a single copy of the master sources. This copy is called the source ``repository''; it contains all the information to permit extracting previous software releases at any time. This manpage provides a brief description of the \fBsvn\fP command. Details as well as more about \fBSubversion\fP as a general version control system is documented in the \fBThe Subversion Handbook\fP. .SH OPTIONS These options are understood by \fBsvn\fP commands. Not all options are available to every command. See the individual command descriptions for details. .TP \fB-?\fP, \fB-h\fP, \fB-H\fP, \fB--help\fP Show help text. .TP \fB-v\fP, \fB--verbose\fP Print additional information. .TP \fB-D\fP, \fB--date\fP \fBDATESPEC\fP Specify which date to operate on. .TP \fB-r\fP, \fB--revision\fP \fBREV\fP Specify repository revision to operate on. Separate multiple revisons with `:'. .TP \fB--version\fP Print client version info. .TP \fB-N\fB, \fB--nonrecursive\fP Local; run only in current working directory. .TP \fB-R\fP, \fB--recursive\fP Operate recursively (default). .TP \fB--force\fP Force operation to run. .TP \fB-m\fP, \fB--message\fP \fBMSG\fP Specify log message. .TP \fB-F\fP, \fB--file ARG\fP Read data from file ARG. .TP \fB--xml-file ARG\fP Read/write xml to specified file ARG. .TP \fB--message-encoding ARG\fP Take log message in charset encoding ARG. .TP \fB--show-updates\fP Display update information. .TP \fB--username ARG\fP Specify a username ARG. .TP \fB--password ARG\fP Specify a password ARG. .TP \fB-x\fP, \fB--extensions ARG\fB Pass ARG as bundled options to GNU diff. .TP \fB--targets\fP Supply a file used as entry and URL args for a given command. You can also supply '-' as the file to read from standard input. The file will be read as one argument for each line, even if given on standard input. .TP \fB-q\fP or \fB--quiet\fP Print as little as possible. .TP \fB--xml\fP Output in xml. .TP \fB--strict\fP Use strict semantics. .TP \fB--no-ignore\fP Disregard default and svn:ignore property ignores. .TP \fB--no-auth-cache\fP Do not cache authentication tokens. .SH COMMANDS svn has many options. Remember to run .B "svn help" to display a list of all commands, and to request a help text for a particular command, run \fBsvn help command\fP. .TP \fBadd\fP \fIfile\fP \fR[\fI--targets file\fR] [\fI-Rq\fR]\fI Use this command to enroll new files in \fBsvn\fP records of your working directory. The files will be added to the repository the next time you run "svn commit". You should use the "svn import" command to bootstrap new sources into the source repository. "svn add" is only used for adding new files to an already checked-out module. \fBexample:\fP svn add foo.c bar.h baz/ bat/*.m .TP \fBcheckout\fP \fIrepository\fP \fR[\fIrepository\|.\|.\|.\fR] [\fIdestination\fR] [\fI--username name\fR] [\fI--password arg\fR] [\fI--no-auth-cache\fR] [\fI--xml-file file\fR] [\fI-rDqN\fR] (Alias: co) A necessary preliminary for most \fBsvn\fP work: creates your private copy of the source for \fIrepository\fP (the repository must be identified with a valid URL string). You can work with this copy without interfering with others' work. At least one subdirectory level is always created. If \fBdestination\fP is omitted the basename of \fBrepository\fP will be used as the destination. If multiple URLs are given each will be checked out into a sub-directory of \fbdestination\fP, with the name of the sub-directory being the basename of the URL. \fBexample:\fP svn checkout http://site.com/repo/svn targetdir .TP \fBcleanup\fP \fItarget\fP Recursively clean up the working copy, removing locks, resuming unfinished operations, etc. .TP \fBcommit\fP \fIfile\fP \fR[\fI--force\fR] [\fI--username name\fR] [\fI--password pass\fR] [\fI--no-auth-cache\fR] [\fI--xml-file\fR] [\fI--message-encoding\fR] [\fI-mFqN\fR] (Alias: ci) Use this command when you wish to ``post'' your changes to other developers, by incorporating them into the source repository. \fBexample:\fP svn commit foo.c bar.h baz/ bat/*.m .TP \fBcopy\fP \fIsource destination\fP \fR[\fI--username name\fR] [\fI--password pass\fR] [\fI--no-auth-cache\fR] [\fI--message-encoding\fR] [\fI-mFrDq\fR] (Alias: cp) Where \fBsource\fP and \fBdestination\fP can be directories or files, local ones in a repository or remote ones specified as URLs. `copy' is used where you want to make a copy of \fBsource\fP so that \fBdestination\fP will share ancestry of \fBsource\fP. Unless \fBdestination\fP is a directory, \fBdestination\fP must not exist (In the spirit of unix cp, \fBsource\fP will be placed inside of \fBdestination\fP if \fBdestination\fP is a directory). \fBexample:\fP If you do this (MAINTAIN ANCESTRY) $ svn copy foo.c bar.c Then foo.c and bar.c will share a common ancestor in the repository. \fBexample:\fP But, if you do this (NO ANCESTRY) $ cp foo.c bar.c $ svn add bar.c $ svn ci -m "Initial Import" Then you will have the identical file in your working copy, but bar.c will have no revision history beyond the initial import that you just did. \fBexample:\fP Make a new copy from a remote source $ svn cp http://rep.com/repo/path/bar.c foo.c $ svn ci -m "copied that remote bar.c here" .TP \fBdelete\fP \fIfile|dir\fP \fR[\fI--force\fR] [\fI--targets file\fR] [\fI--username name\fR] [\fI--password pass\fR] [\fI--no-auth-cache\fR] [\fI--xml-file\fR] [\fI--message-encoding\fR] [\fI-mFq\fR]\fI (Alias: del, remove, rm) Mark the given files/directories for deletion upon commit. When you commit, the entries will be removed from the head revision in the repository, and deleted from your working copy. \fBexample:\fP svn delete foo.c bar.h .TP \fBdiff\fP [\fItarget...\fP] [\fI--username name\fR] [\fI--password pass\fR] [\fI--no-auth-cache\fR] [\fI-rDxN\fR]\fI (Alias: di) Display file changes as contextual diffs. The target can be a directory, in which it operates recursively. The target can be an URL, although this is only useful if two revisions are also given. -r/--revision with a single revision causes comparison with the specified repository revision. With two revisions the comparison is between the two specified repository revisions. If this option is not given the comparison is between the working copy and its current repository revision. -N/--nonrecursive with a directory target will prevent recursive descent into subdirectories. \fBexample:\fP svn diff README Compares the working copy version of the file with current repository version. \fBexample:\fP svn diff -rHEAD README Compares the working copy with most recent repository version. \fBexample:\fP svn diff -r123:456 README Compares revisions 123 and 456 of the file in the repository. \fBexample:\fP svn diff -r123:456 http://rep.com/repo/README Compare revisions 123 and 456 of the file in the repository without the need for a working copy. .TP \fBexport\fP \fIsource \fR[\fIdestination\fR] [\fI--username name\fR] [\fI--password pass\fR] [\fI--no-auth-cache\fR] [\fI-rDq\fR] If source is a URL exports a clean directory tree from the repository specified by URL, at revision REV if it is given, otherwise at HEAD, into destination. If source is a path exports a clean directory tree from the working copy specified by PATH. All local changes will be preserved, but files not under revision control will not be copied. NOTE: If destination is omitted, the last component of the URL is used for the local directory name. .TP \fBhelp\fP [\fIcommand\fP] (Alias: ?, h) Without a given command argument, this prints generic help. If a specific command is entered, a short description on how to use that command is presented. .TP \fBimport\fP \fIRepository-URL\fP [\fIPath\fP] [\fINew-Repository-Entry\fP] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI--xml-file\fP] [\fI--message-encoding\fP] [\fI-FmqN\fP] Import a file or tree into the repository. .TP \fBinfo\fP \fItarget1\fP [\fItarget2\fP ...] [\fI--targets file\fP] [\fI-R\fP] Print info about a versioned resource. .TP \fBlist\fP \fIurl\fP [\fIurl\fP ...] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI-rDvR\fP] (Alias: ls) List directory entries of a URL. .TP \fBlog\fP [\fIurl\fP] [\fIfile|dir\fP] [\fINew-Repository-Entry\fP] [\fI--targets file\fP] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI--strict] [\fI--xml\fP] [\fI-rDv\fP] Show log messages (and affected entities) for commits in which any of the entities in question changed. If none were specified, then recursive inclusion is the default. The set of messages can be further restricted by a date or revision range specification (using -D or -r). A URL can also be specific to retrieve logs from a remote repository. If the URL is passed alone, then only that entry will be searched. If paths are also supplied with the URL, then only those paths are searched, based at the given URL. \fBexample:\fP svn log Recursively retrieve logs for all revision under "." \fBexample:\fP svn log README Retrieve logs for only those revisions where README was affected. \fBexample:\fP svn log http://rep.com/repo/README Retrieve logs for the file without the need for a local checkout of the repository. \fBexample:\fP svn log README LICENSE Retrive logs for all revisions where both files were affected. \fBexample:\fP svn log http://rep.com/repo README LICENSE Retrieve logs for both files in the remote repository without the need for a local checkout of the repository. .TP \fBmerge\fP \fIPATH1\fP[\fI@N\fP] [\fIPATH2\fP[\fI@M\fP]] [\fIWCPATH\fP] [\fI--force\fP] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI-rDNq\fP] Apply the differences between two paths to a working copy path. PATH1 and PATH2 are either working-copy paths or URLs, specified at revisions N and M. These are the two sources to be compared. N and M default to HEAD if omitted. WCPATH is the working-copy path that will receive the changes. If omitted, a default value of '.' is assumed. If PATH2 is omitted the revision option must be passed to identify two versions of PATH1, for example: .SP .in +0.2i .ft B .nf svn merge -r4:5 http://ex.com/repos/proj .fi .ft P .in -0.2i .SP .TP \fBmkdir\fP [\fIdirectory...\fP] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI--message-encoding\fP] [\fI-mFq\fP] Create the directory(ies), if they do not already exist. The directories can be specified as a local directory name, or as a URL. .TP \fBmove\fP [\fISOURCE\fP] [\fIDEST\fP] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI--force\fP] [\fI--message-encoding\fP] [\fI-mFrDq\fP] (alias: mv, rename, ren) Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. Both source and dest can be specified either as a local file name, or as a URL in a possibly remote repository. .TP \fBpropdel\fP \fIpropname\fP [\fItargets\fP] [\fI-qR\fP] (Alias: pdel) Remove property \fIpropname\fP on files and directories. .TP \fBpropedit\fP \fIpropname\fP [\fItargets\fP] (Alias: pedit, pe) Edit property \fIpropname\fP with $EDITOR on files and directories. .TP \fBpropget\fP \fIpropname\fP [\fItargets\fP] [\fI-R\fP] (Alias: pget, pg) Get the value of \fIpropname\fP on files and directories. .TP \fBproplist\fP [\fItargets\fP] [\fI-vR\fP] (Alias: plist, pl) List all properties for given files and directories. .TP \fBpropset\fP \fIpropname\fP [\fIpropval\fP] [\fItargets\fP] [\fI--targets file\fP] [\fI-FqR\fP] (Alias: pset, ps) Set property \fIpropname\fP to \fIpropval\fP on files and directories. Note: svn recognizes the following special properties but will store any arbitrary properties set: .RS .IP svn:ignore A newline separated list of file patterns to ignore. .IP svn:keywords Keywords to be expanded. Valid keywords are: .RS .IP "URL, HeadURL" The URL for the head version of the object. .IP "Author, LastChangedBy" The last person to modify the file. .IP "Date, LastChangedDate" The date/time the object was last modified. .IP "Rev, LastChangedRevision" The last revision the object changed. .RE .IP svn:executable If present, make the file executable. This property cannot be set on a directory. A non-recursive attempt will fail, and a recursive attempt will set the property only on the file children of the directory. .IP svn:eol-style One of 'native', 'LF', 'CR', 'CRLF'. .IP svn:mime-type The mimetype of the file. Used to determine whether to merge the file, and how to serve it from Apache. A mimetype beginning with 'text/' (or an absent mimetype) is treated as text. Anything else is treated as binary. .IP svn:externals A newline separated list of module specifiers, each of which consists of a relative directory path, optional revision flags, and an URL. For example : .SP .in +0.2i .ft B .nf foo http://ex.com/repos/zig foo/bar -r1234 http://ex.com/repos/zag .fi .ft P .in -0.2i .SP .RE .TP \fBrevert\fP [\fIfile\fP\|.\|.\|.] [\fI--targets file\fP] [\fI-Rq\fP] Restore a pristine working copy version of file, undoing all local changes. .TP \fBresolve\fP \fItarget\fP [\fItarget\fP\|.\|.\|.] [\fI--targets file\fP] [\fI-Rq\fP] Remove 'conflicted' state on working copy files or directories. Note: this routine does not semantically resolve conflict markers; it merely removes conflict-related artifact files and allows TARGET to be committed again. .TP \fBstatus\fP [\fItargets\fP] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI--no-ignore\fP] [\fI-uvNq\fP] (Alias: stat, st) Print the status of working copy files and directories. .TP \fBswitch url\fP [\fItarget\fP] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI-rDNq\fP] (Alias: sw) Update working copy to mirror a new URL. This is the way to move a working copy to a new branch. .TP \fBupdate\fP [\fIfile\fP\|.\|.\|.] [\fI--username name\fP] [\fI--password pass\fP] [\fI--no-auth-cache\fP] [\fI--xml-file\fP] [\fI-rDNq\fP] (Alias: up) Bring changes from the repository into the working copy. If no revision given, bring working copy up-to-date with HEAD rev. Else synchronize working copy to revision given by -r or -D. For each updated item a line will start with a character reporting the action taken. These characters have the following meaning: .RS .IP A Added .IP D Deleted .IP U Updated .IP C Conflict .IP G Merged .RE .RS \fBexample:\fP svn update foo.c bar.h baz/ bat/*.m .SH WWW http://subversion.tigris.org .SH "SEE ALSO" .BR svnadmin (1)