Name

merge

Synopsis

svn merge sourceURL1[@N] sourceURL2[@M] [wcpath]
svn merge -r N:M source [path]

In the first form, the source URLs are specified at revisions N and M. These are the two sources to be compared. The revisions default to HEAD if omitted.

In the second form, source can be a URL or working copy item, in which case the corresponding URL is used. This URL, at revisions N and M, defines the two sources to be compared.

wcpath is the working copy path that will receive the changes. If wcpath is omitted, a default value of “.” is assumed, unless the sources have identical basenames that match a file within “.”, in which case, the differences are applied to that file.

Unlike svn diff, this 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.

Alternate Names:

None

Changes:

Working copy

Accesses Repository:

Only if working with URLs

Options

--config-dir dir

--non-interactive

--diff3-cmd cmd

--non-recursive (-N)

--dry-run

--password pass

--force

--quiet (-q)

--ignore-ancestry

--revisionrev, -rrev

--no-auth-cache

--username user

Examples

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):

    $ svn 
                            
 merge -r 250:HEAD \
    >         http://svn.red-bean.com/repos/branches/my-branch U myproj/tiny.txt U myproj/thhgttg.txt ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.