Currently, I have a large SVN repository with a bunch of different projects within it, as follows:
/
Project1/
trunk/
tags/
branches/
Project2/
trunk/
tags/
branches/
Project3/
(etc...)
However, I'm now trying to break it up into separate repositories (for various reasons), and I would like the following for each project:
/
trunk/
tags/
branches/
If possible, all history and externals should remain intact. However, I'm unsure if this can actually be done. I have seen several questions similar to this on SO but none entirely addresses the issue I have here. Basically I am trying to "pull out" a subdirectory and its entire contents with history from the old repository and plop the whole lot into its own (new) repository.
Am I asking the impossible?
The easiest way to copy files and folders from within a working copy is to use the right drag menu. When you right drag a file or folder from one working copy to another, or even within the same folder, a context menu appears when you release the mouse.
You can migrate a repository using the svnadmin dump function. On the SVN server, type svnadmin dump /absolute/path/to/the/repo > /tmp/repo. svndump . This will export the entire repository to a text file in the system's temporary directory and name it "repo.
# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...
Use
svnadmin dump path/to/repository > repo.dmp
and then use svndumpfilter to only load a subtree into a new repository.
Since SVN 1.7 you could use
svnrdump dump path/to/repository > dump
to get the dump. While Stefans solution works, it does require access to the server hostig the repo. svnrdump works over the net with any repo you can read from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With