<?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>svn merge</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.svn.html#svn.ref.svn.c" title="svn Subcommands" /><link rel="prev" href="svn.ref.svn.c.log.html" title="svn log" /><link rel="next" href="svn.ref.svn.c.mergeinfo.html" title="svn mergeinfo" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">svn merge</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="svn.ref.svn.c.log.html">Prev</a> </td><th width="60%" align="center"><span class="command"><strong>svn</strong></span> Subcommands</th><td width="20%" align="right"> <a accesskey="n" href="svn.ref.svn.c.mergeinfo.html">Next</a></td></tr></table><hr /></div><div class="refentry" lang="en" xml:lang="en"><a id="svn.ref.svn.c.merge"></a><div class="titlepage"></div><a id="id418552" class="indexterm"></a><div class="refnamediv"><h2>Name</h2><p>svn merge — Apply the differences between two sources to a working copy path.</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id418578"></a><h2>Synopsis</h2><pre class="programlisting">svn merge sourceURL1[@N] sourceURL2[@M] [WCPATH]</pre><pre class="programlisting">svn merge sourceWCPATH1@N sourceWCPATH2@M [WCPATH]</pre><pre class="programlisting">svn merge [[-c M]... | [-r N:M]...] [SOURCE[@REV] [WCPATH]]</pre></div><div class="refsect1" lang="en" xml:lang="en"><a id="id418603"></a><h2>Description</h2><p>In the first form, the source URLs are specified at revisions <code class="literal">N</code> and <code class="literal">M</code>. These are the two sources to be compared. The revisions default to <code class="literal">HEAD</code> if omitted.</p><p>In the second form, the URLs corresponding to the source working copy paths define the sources to be compared. The revisions must be specified.</p><p>In the third form, <em class="replaceable"><code>SOURCE</code></em> can be either a URL or a working copy path (in which case its corresponding URL is used). If not specified, <em class="replaceable"><code>SOURCE</code></em> will be the same as <em class="replaceable"><code>WCPATH</code></em>. <em class="replaceable"><code>SOURCE</code></em> in revision <em class="replaceable"><code>REV</code></em> is compared as it existed between revisions <em class="replaceable"><code>N</code></em> and <em class="replaceable"><code>M</code></em> for each revision range provided. If <em class="replaceable"><code>REV</code></em> is not specified, <code class="literal">HEAD</code> is assumed.</p><p><code class="literal">-c M</code> is equivalent to <code class="literal">-r <M-1>:M</code>, and <code class="literal">-c -M</code> does the reverse: <code class="literal">-r M:<M-1></code>. If no revision ranges are specified, the default range of <code class="literal">1:HEAD</code> is used. Multiple <code class="literal">-c</code> and/or <code class="literal">-r</code> instances may be specified, and mixing of forward and reverse ranges is allowed—the ranges are internally compacted to their minimum representation before merging begins (which may result in no-op).</p><p><em class="replaceable"><code>WCPATH</code></em> is the working copy path that will receive the changes. If <em class="replaceable"><code>WCPATH</code></em> is omitted, a default value of “<span class="quote"><code class="filename">.</code></span>” is assumed, unless the sources have identical basenames that match a file within “<span class="quote"><code class="filename">.</code></span>”: in which case, the differences will be applied to that file.</p><p>Subversion will only internally track metadata about the merge operation if the two sources are ancestrally related—if the first source is an ancestor of the second, or vice-versa. This is guaranteed to be the case when using the third form. Unlike <span class="command"><strong>svn diff</strong></span>, the merge command takes the ancestry of a file into consideration when performing a merge operation. This is very important when you're merging changes from one branch into another and you've renamed a file on one branch but not the other.</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id418763"></a><h2>Alternate Names</h2><p>None</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id418773"></a><h2>Changes</h2><p>Working copy</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id418783"></a><h2>Accesses Repository</h2><p>Only if working with URLs</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id418793"></a><h2>Options</h2><pre class="screen"> --revision (-r) REV --change (-c) REV --depth ARG --record-only --accept ARG --quiet (-q) --force --dry-run --diff3-cmd CMD --extensions (-x) ARG --ignore-ancestry --username USER --password PASS --no-auth-cache --non-interactive --config-dir DIR </pre></div><div class="refsect1" lang="en" xml:lang="en"><a id="id418808"></a><h2>Examples</h2><p>Merge a branch back into the trunk (assuming that you have a working copy of the trunk, and that the branch was created in revision 250):</p><pre class="screen"> $ svn merge -r 250:HEAD http://svn.red-bean.com/repos/branches/my-branch U myproj/tiny.txt U myproj/thhgttg.txt U myproj/win.txt U myproj/flo.txt </pre><p>If you branched at revision 23, and you want to merge changes on trunk into your branch, you could do this from inside the working copy of your branch:</p><pre class="screen"> $ svn merge -r 23:30 file:///var/svn/repos/trunk/vendors U myproj/thhgttg.txt … </pre><p>To merge changes to a single file:</p><pre class="screen"> $ cd myproj $ svn merge -r 30:31 thhgttg.txt U thhgttg.txt </pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="svn.ref.svn.c.log.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="svn.ref.svn.html#svn.ref.svn.c">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="svn.ref.svn.c.mergeinfo.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">svn log </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> svn mergeinfo</td></tr></table></div></body></html>