How to svn-merge a directory into a branch where it originally didn't exist

11,409

Make sure that you're in working copy dirA

cd branches/foo/dirA

Merge dirB into foo/dirA

svn merge ssh://server/svn/trunk/dirB .


EDIT:
Branches are created using svn cp:

svn cp ssh://server/svn/trunk/dirB ssh://server/svn/branches/foo/dirB -m"dirB branch created"
Share:
11,409
Philipp
Author by

Philipp

Updated on June 06, 2022

Comments

  • Philipp
    Philipp almost 2 years

    Suppose the following structure on an svn server:

    -svn-|
         |-trunk --- |
         |           | - dirA
         |           | - dirB
         |
         |-branches -|
                     | - foo - |
                               | - dirA
    

    At a revision X, the foo branch was created from the trunk. Some time later at revision Y, directory dirB was created in the trunk. Now, at revision Z, i want to integrate dirB (rev Z) into the foo branch.

    I tried:

    md dirB
    svn add dirB
    svn merge --dry-run --force ssh://server/svn/trunk/dirB dirB
    

    and

    svn merge -rY:Z--dry-run --force ssh://server/svn/trunk/dirB dirB
    

    and also

    cd dirB
    svn merge --dry-run --force ssh://server/svn/trunk/dirB .
    

    Everytime I get

    Summary of conflicts:
      Tree conflicts: 34
    

    How to do this merge?

    • João Portela
      João Portela over 13 years
      I think you may be complicating. svn cp seems does the trick.
  • Philipp
    Philipp over 13 years
    This way I get the contents of dirB into dirA. What I want is (as in the trunk) dirB as a separate directory besides dirA. And I keep getting the tree conflicts either way.
  • zellus
    zellus over 13 years
    @Philipp: Hope my additional comment answers your question.
  • holms
    holms about 11 years
    bless you for this command, this is only way i've found to "create" branch.. i came from git so for me svn is hell...