<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Subversion Command Line Client: svn</title><link rel="stylesheet" href="styles.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><link rel="start" href="index.html" title="Version Control with Subversion" /><link rel="up" href="svn.ref.html" title="Chapter 9. Subversion Complete Reference" /><link rel="prev" href="svn.ref.html" title="Chapter 9. Subversion Complete Reference" /><link rel="next" href="svn.ref.svn.c.add.html" title="svn add" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The Subversion Command Line Client: <span class="command"><strong>svn</strong></span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="svn.ref.html">Prev</a> </td><th width="60%" align="center">Chapter 9. Subversion Complete Reference</th><td width="20%" align="right"> <a accesskey="n" href="svn.ref.svn.c.add.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="svn.ref.svn"></a>The Subversion Command Line Client: <span class="command"><strong>svn</strong></span></h2></div></div></div><p>To use the command line client, you type <span class="command"><strong>svn</strong></span>, the subcommand you wish to use <sup>[<a id="id413132" href="#ftn.id413132" class="footnote">58</a>]</sup>, and any options or targets that you wish to operate on—there is no specific order that the subcommand and the options must appear in. For example, all of the following are valid ways to use <span class="command"><strong>svn status</strong></span>:</p><pre class="screen"> $ svn -v status $ svn status -v $ svn status -v myfile </pre><p>You can find many more examples of how to use most client commands in <a class="xref" href="svn.tour.html" title="Chapter 2. Basic Usage">Chapter 2, <i>Basic Usage</i></a> and commands for managing properties in <a class="xref" href="svn.advanced.props.html" title="Properties">the section called “Properties”</a>.</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="svn.ref.svn.sw"></a><span class="command"><strong>svn</strong></span> Options</h3></div></div></div><p>While Subversion has different options for its subcommands, all options are global—that is, each option is guaranteed to mean the same thing regardless of the subcommand you use it with. For example, <code class="option">--verbose</code> (<code class="option">-v</code>) always means “<span class="quote">verbose output</span>”, regardless of the subcommand you use it with.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--accept</code> <em class="replaceable"><code>ACTION</code></em></span></dt><dd><p>Specify action for automatic conflict resolution. Possible actions are (<code class="literal">postpone</code>, <code class="literal">base</code>, <code class="literal">mine</code>, <code class="literal">theirs</code>, <code class="literal">edit</code>, and <code class="literal">launch</code></p></dd><dt><span class="term"><code class="option">--auto-props</code></span></dt><dd><p>Enables auto-props, overriding the <code class="literal">enable-auto-props</code> directive in the <code class="filename">config</code> file.</p></dd><dt><span class="term"><code class="option">--change</code> (<code class="option">-c</code>) <em class="replaceable"><code>ARG</code></em></span></dt><dd><p>Used as a means to refer to a specific “<span class="quote">change</span>” (aka a revision), this option is syntactic sugar for “<span class="quote">-r ARG-1:ARG</span>”.</p></dd><dt><span class="term"><code class="option">--changelist</code> <em class="replaceable"><code>ARG</code></em></span></dt><dd><p>Operate only on members of changelist named <em class="replaceable"><code>ARG</code></em>.</p></dd><dt><span class="term"><code class="option">--config-dir</code> <em class="replaceable"><code>DIR</code></em></span></dt><dd><p>Instructs Subversion to read configuration information from the specified directory instead of the default location (<code class="filename">.subversion</code> in the user's home directory).</p></dd><dt><span class="term"><code class="option">--depth</code> <em class="replaceable"><code>ARG</code></em></span></dt><dd><p>Set the depth on a directory in a working copy to one of <code class="literal">empty</code>, <code class="literal">files</code>, <code class="literal">immediates</code>, or <code class="literal">infinity</code>.</p></dd><dt><span class="term"><code class="option">--diff-cmd</code> <em class="replaceable"><code>CMD</code></em></span></dt><dd><p>Specifies an external program to use to show differences between files. When <span class="command"><strong>svn diff</strong></span> is invoked without this option, it uses Subversion's internal diff engine, which provides unified diffs by default. If you want to use an external diff program, use <code class="option">--diff-cmd</code>. You can pass options to the diff program with the <code class="option">--extensions</code> option (more on that later in this section).</p></dd><dt><span class="term"><code class="option">--diff3-cmd</code> <em class="replaceable"><code>CMD</code></em></span></dt><dd><p>Specifies an external program to use to merge files.</p></dd><dt><span class="term"><code class="option">--dry-run</code></span></dt><dd><p>Goes through all the motions of running a command, but makes no actual changes—either on disk or in the repository.</p></dd><dt><span class="term"><code class="option">--editor-cmd</code> <em class="replaceable"><code>CMD</code></em></span></dt><dd><p>Specifies an external program to use to edit a log message or a property value. See the <code class="literal">editor-cmd</code> section in <a class="xref" href="svn.advanced.confarea.html#svn.advanced.confarea.opts.config" title="Config">the section called “Config”</a> for ways to specify a default editor.</p></dd><dt><span class="term"><code class="option">--encoding</code> <em class="replaceable"><code>ENC</code></em></span></dt><dd><p>Tells Subversion that your commit message is encoded in the charset provided. The default is your operating system's native locale, and you should specify the encoding if your commit message is in any other encoding.</p></dd><dt><span class="term"><code class="option">--extensions</code> (<code class="option">-x</code>) <em class="replaceable"><code>ARGS</code></em></span></dt><dd><p>Specifies an argument or arguments that Subversion should pass to an external diff command. This option is valid only when used with the <span class="command"><strong>svn diff</strong></span> or <span class="command"><strong>svn merge</strong></span> commands, with the <code class="option">--diff-cmd</code> option. If you wish to pass multiple arguments, you must enclose all of them in quotes (for example, <span class="command"><strong>svn diff --diff-cmd /usr/bin/diff -x "-b -E"</strong></span>).</p></dd><dt><span class="term"><code class="option">--file</code> (<code class="option">-F</code>) <em class="replaceable"><code>FILENAME</code></em> </span></dt><dd><p>Uses the contents of the named file for the specified subcommand, though different subcommands do different things with this content. For example, <span class="command"><strong>svn commit</strong></span> uses the content as a commit log, whereas <span class="command"><strong>svn propset</strong></span> uses it as a property value.</p></dd><dt><span class="term"><code class="option">--force</code></span></dt><dd><p>Forces a particular command or operation to run. There are some operations that Subversion will prevent you from doing in normal usage, but you can pass the force option to tell Subversion “<span class="quote">I know what I'm doing as well as the possible repercussions of doing it, so let me at 'em</span>”. This option is the programmatic equivalent of doing your own electrical work with the power on—if you don't know what you're doing, you're likely to get a nasty shock.</p></dd><dt><span class="term"><code class="option">--force-log</code></span></dt><dd><p>Forces a suspicious parameter passed to the <code class="option">--message</code> (<code class="option">-m</code>) or <code class="option">--file</code> (<code class="option">-F</code>) options to be accepted as valid. By default, Subversion will produce an error if parameters to these options look like they might instead be targets of the subcommand. For example, if you pass a versioned file's path to the <code class="option">--file</code> (<code class="option">-F</code>) option, Subversion will assume you've made a mistake, that the path was instead intended as the target of the operation, and that you simply failed to provide some other—unversioned—file as the source of your log message. To assert your intent and override these types of errors, pass the <code class="option">--force-log</code> option to subcommands that accept log messages.</p></dd><dt><span class="term"><code class="option">--help</code> (<code class="option">-h</code> or <code class="option">-?</code>) </span></dt><dd><p>If used with one or more subcommands, shows the built-in help text for each subcommand. If used alone, it displays the general client help text.</p></dd><dt><span class="term"><code class="option">--ignore-ancestry</code></span></dt><dd><p>Tells Subversion to ignore ancestry when calculating differences (rely on path contents alone).</p></dd><dt><span class="term"><code class="option">--ignore-externals</code></span></dt><dd><p>Tells Subversion to ignore external definitions and the external working copies managed by them.</p></dd><dt><span class="term"><code class="option">--incremental</code></span></dt><dd><p>Prints output in a format suitable for concatenation.</p></dd><dt><span class="term"><code class="option">--keep-changelist</code></span></dt><dd><p>Don't delete changelist after commit.</p></dd><dt><span class="term"><code class="option">--keep-local</code></span></dt><dd><p>Keep the local copy of a file or directory (used with the <span class="command"><strong>svn delete</strong></span> command).</p></dd><dt><span class="term"><code class="option">--limit</code> <em class="replaceable"><code>NUM</code></em></span></dt><dd><p>Show only the first <em class="replaceable"><code>NUM</code></em> log messages.</p></dd><dt><span class="term"><code class="option">--message</code> (<code class="option">-m</code>) <em class="replaceable"><code>MESSAGE</code></em> </span></dt><dd><p>Indicates that you will specify a either a log message or a lock comment on the command line, following this option. For example:</p><pre class="screen"> $ svn commit -m "They don't make Sunday." </pre></dd><dt><span class="term"><code class="option">--new</code> <em class="replaceable"><code>ARG</code></em></span></dt><dd><p>Uses <em class="replaceable"><code>ARG</code></em> as the newer target (for use with <span class="command"><strong>svn diff</strong></span>).</p></dd><dt><span class="term"><code class="option">--no-auth-cache</code></span></dt><dd><p>Prevents caching of authentication information (e.g. username and password) in the Subversion administrative directories.</p></dd><dt><span class="term"><code class="option">--no-auto-props</code></span></dt><dd><p>Disables auto-props, overriding the <code class="literal">enable-auto-props</code> directive in the <code class="filename">config</code> file.</p></dd><dt><span class="term"><code class="option">--no-diff-deleted</code></span></dt><dd><p>Prevents Subversion from printing differences for deleted files. The default behavior when you remove a file is for <span class="command"><strong>svn diff</strong></span> to print the same differences that you would see if you had left the file but removed all the content.</p></dd><dt><span class="term"><code class="option">--no-ignore</code></span></dt><dd><p>Shows files in the status listing that would normally be omitted since they match a pattern in the <code class="literal">global-ignores</code> configuration option or the <code class="literal">svn:ignore</code> property. See <a class="xref" href="svn.advanced.confarea.html#svn.advanced.confarea.opts.config" title="Config">the section called “Config”</a> and <a class="xref" href="svn.advanced.props.special.ignore.html" title="Ignoring Unversioned Items">the section called “Ignoring Unversioned Items”</a> for more information.</p></dd><dt><span class="term"><code class="option">--no-unlock</code></span></dt><dd><p>Don't automatically unlock files (the default commit behavior is to unlock all files listed as part of the commit). See <a class="xref" href="svn.advanced.locking.html" title="Locking">the section called “Locking”</a> for more information.</p></dd><dt><span class="term"><code class="option">--non-interactive</code></span></dt><dd><p>In the case of an authentication failure, or insufficient credentials, prevents prompting for credentials (e.g. username or password). This is useful if you're running Subversion inside of an automated script and it's more appropriate to have Subversion fail than to prompt for more information.</p></dd><dt><span class="term"><code class="option">--non-recursive</code> (<code class="option">-N</code>)</span></dt><dd><p><span class="emphasis"><em>Deprecated</em></span>. Stops a subcommand from recursing into subdirectories. Most subcommands recurse by default, but some subcommands—usually those that have the potential to remove or undo your local modifications—do not.</p></dd><dt><span class="term"><code class="option">--notice-ancestry</code></span></dt><dd><p>Pay attention to ancestry when calculating differences.</p></dd><dt><span class="term"><code class="option">--old</code> <em class="replaceable"><code>ARG</code></em></span></dt><dd><p>Uses <em class="replaceable"><code>ARG</code></em> as the older target (for use with <span class="command"><strong>svn diff</strong></span>).</p></dd><dt><span class="term"><code class="option">--parents</code></span></dt><dd><p>Create and add non-existent or non-versioned parent subdirectories to the working copy or repository as part of an operation. This is useful for automatically creating multiple subdirectories where none currently exist. If performed on a URL, all the directories will be created in a single commit.</p></dd><dt><span class="term"><code class="option">--password</code> <em class="replaceable"><code>PASS</code></em></span></dt><dd><p>Indicates that you are providing your password for authentication on the command line—otherwise, if it is needed, Subversion will prompt you for it.</p></dd><dt><span class="term"><code class="option">--quiet</code> (<code class="option">-q</code>)</span></dt><dd><p>Requests that the client print only essential information while performing an operation.</p></dd><dt><span class="term"><code class="option">--record-only</code></span></dt><dd><p>Mark revisions as merged (for use with <code class="option">--revision</code> (<code class="option">-r</code>)</p></dd><dt><span class="term"><code class="option">--recursive</code> (<code class="option">-R</code>)</span></dt><dd><p><span class="emphasis"><em>Deprecated</em></span>. Makes a subcommand recurse into subdirectories. Most subcommands recurse by default.</p></dd><dt><span class="term"><code class="option">--relocate</code> <em class="replaceable"><code>FROM TO [PATH...]</code></em></span></dt><dd><p>Used with the <span class="command"><strong>svn switch</strong></span> subcommand, changes the location of the repository that your working copy references. This is useful if the location of your repository changes and you have an existing working copy that you'd like to continue to use. See <span class="command"><strong>svn switch</strong></span> for an example.</p></dd><dt><span class="term"><code class="option">--remove</code> <em class="replaceable"><code>ARG</code></em></span></dt><dd><p>Disassociate <em class="replaceable"><code>ARG</code></em> from a changelist</p></dd><dt><span class="term"><code class="option">--revision</code> (<code class="option">-r</code>) <em class="replaceable"><code>REV</code></em> </span></dt><dd><p>Indicates that you're going to supply a revision (or range of revisions) for a particular operation. You can provide revision numbers, revision keywords or dates (in curly braces), as arguments to the revision option. If you wish to provide a range of revisions, you can provide two revisions separated by a colon. For example:</p><pre class="screen"> $ svn log -r 1729 $ svn log -r 1729:HEAD $ svn log -r 1729:1744 $ svn log -r {2001-12-04}:{2002-02-17} $ svn log -r 1729:{2002-02-17} </pre><p>See <a class="xref" href="svn.tour.revs.specifiers.html#svn.tour.revs.keywords" title="Revision Keywords">the section called “Revision Keywords”</a> for more information.</p></dd><dt><span class="term"><code class="option">--revprop</code></span></dt><dd><p>Operates on a revision property instead of a property specific to a file or directory. This option requires that you also pass a revision with the <code class="option">--revision</code> (<code class="option">-r</code>) option.</p></dd><dt><span class="term"><code class="option">--show-updates</code> (<code class="option">-u</code>)</span></dt><dd><p>Causes the client to display information about which files in your working copy are out-of-date. This doesn't actually update any of your files—it just shows you which files will be updated if you run <span class="command"><strong>svn update</strong></span>. </p></dd><dt><span class="term"><code class="option">--stop-on-copy</code></span></dt><dd><p>Causes a Subversion subcommand which is traversing the history of a versioned resource to stop harvesting that historical information when a copy—that is, a location in history where that resource was copied from another location in the repository—is encountered.</p></dd><dt><span class="term"><code class="option">--strict</code></span></dt><dd><p>Causes Subversion to use strict semantics, a notion which is rather vague unless talking about specific subcommands (namely, <span class="command"><strong>svn propget</strong></span>).</p></dd><dt><span class="term"><code class="option">--targets</code> <em class="replaceable"><code>FILENAME</code></em></span></dt><dd><p>Tells Subversion to get the list of files that you wish to operate on from the filename you provide instead of listing all the files on the command line. </p></dd><dt><span class="term"><code class="option">--username</code> <em class="replaceable"><code>NAME</code></em></span></dt><dd><p>Indicates that you are providing your username for authentication on the command line—otherwise, if it is needed, Subversion will prompt you for it.</p></dd><dt><span class="term"><code class="option">--use-merge-history</code> (<code class="option">-g</code>)</span></dt><dd><p>Use or display additional information from merge history. When used with svn copy or svn move, the client will contact the server in order to propagate merge history information. When used with other commands, the client will display merge history information.</p></dd><dt><span class="term"><code class="option">--verbose</code> (<code class="option">-v</code>)</span></dt><dd><p>Requests that the client print out as much information as it can while running any subcommand. This may result in Subversion printing out additional fields, detailed information about every file, or additional information regarding its actions.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Prints the client version info. This information not only includes the version number of the client, but also a listing of all repository access modules that the client can use to access a Subversion repository. With <code class="option">--quiet</code> (<code class="option">-q</code>) it prints only the version number in a compact form.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Prints the client version info. This information not only includes the version number of the client, but also a listing of all repository access modules that the client can use to access a Subversion repository. With <code class="option">--quiet</code> (<code class="option">-q</code>) it prints only the version number in a compact form.</p></dd><dt><span class="term"><code class="option">--with-all-revprops</code></span></dt><dd><p>Used with <span class="command"><strong>svn log --xml</strong></span>, this option will retrieve and display all revision properties in the log output.</p></dd><dt><span class="term"><code class="option">--with-revprop</code> <em class="replaceable"><code>ARG</code></em></span></dt><dd><p>When used with any command that writes to the repository, set the revision property, using thn <em class="replaceable"><code>NAME=VALUE</code></em> format, <em class="replaceable"><code>NAME</code></em> to <em class="replaceable"><code>VALUE</code></em>. When used with <span class="command"><strong>svn log --xml</strong></span>, display the value of <em class="replaceable"><code>ARG</code></em> in the log output.</p></dd><dt><span class="term"><code class="option">--xml</code></span></dt><dd><p>Prints output in XML format.</p></dd></dl></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="svn.ref.svn.c"></a><span class="command"><strong>svn</strong></span> Subcommands</h3></div></div></div><p>Here are the various subcommands:</p></div><div class="footnotes"><br /><hr width="100" align="left" /><div class="footnote"><p><sup>[<a id="ftn.id413132" href="#id413132" class="para">58</a>] </sup>Yes, yes, you don't need a subcommand to use the <code class="option">--version</code> option, but we'll get to that in just a minute.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="svn.ref.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="svn.ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="svn.ref.svn.c.add.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 9. Subversion Complete Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> svn add</td></tr></table></div></body></html>