SVN move single directory into other repository (w

2019-01-31 03:53发布

Related question: Moving repository trunk to another’s branch (with history)


I know that one can dump a complete SVN repository with history and load it into a user-defined (sub)directory of the target repository using:

// in source repo
> svnadmin dump . > mydumpfilename

// in destination repo (backslashes because I'm using Windows)
> svnadmin load . < mydumpfilename --parent-dir some\sub\directory

But this will import the full repository into the target repository's sub-directory. What I want is to define a sub-directory in the source repository that should be exported. Something like svnadmin dump . --source-path old\sub\dir > mydumpfilename.

How can I achieve that? If TortoiseSVN can do that, please say so ;)


SOLUTION: Thanks to Tim Henigan's answer, here's the correct way to do it:

// execute in destination repo
svndumpfilter include source\sub\dir < mydumpfilename | svnadmin load . --parent-dir destination\sub\dir

Hope this will help others, too...

2条回答
Explosion°爆炸
2楼-- · 2019-01-31 04:30

Check out svndumpfilter and this section on Repository Maintenance.

Once you have a dumpfile for the entire old repository, you can use svndumpfilter to extract just the portion that you want.

I am not aware of a way to do this with TortoiseSVN.

查看更多
成全新的幸福
3楼-- · 2019-01-31 04:39

A little late to the party, but... if you have pulled local copies of both repositories using TortoiseSVN, you can actually copy a directory from one to the other with history by right-clicking on the directory (or file) from Repo1 and dragging it to Repo2. When you release the mouse you will get this list of options:

enter image description here

"SVN Export versioned items here" will copy (recursively) with history.

查看更多
登录 后发表回答