SVN copy certain subdirectories to a branch

There was always a problem for me to copy only certain directories from one branch to another.
For example we have following directory structure:
trunk
      - project1
      - project2
          -subdir1
          -subdir2
          -subdir3        
We want to copy only subdir2 to a branch /branches/branch1 with saving all the structure of projects.
branches/branch1
      - project1
      - project2
          -subdir2
We want to copy only subdir2 to a branch /branches/branch1 with saving all the structure of projects.
Such a manipulation is required if you want to make a private branch for outsorcer and you don't wan him to see the other parts of the code. However you want to support reintegration of the branch back to the trunk.

The solution is 
svn cp --parents ./project2/subdir2 http://repo.url/branches/branch1/project2/subdir2
or
svn cp --parents http://<svn_path>/trunk/project2/subdir2 <working copy path>/branches/branch1/project2/subdir2
Subversion creates all intermediate directories.

No comments:

Post a Comment