I made the mistake of creating a Subversion repository without the usual trunk
, branches
, and tags
directories. That is, the root directory of the project maps to the root directory of the repository. Now I want to create a feature branch, but there's no good place to put it. What I'd like to do is move /
to /trunk
, preserving its properties and history. Am I out of luck?
The clean way to do this is using svnadmin
to dump out the whole repository using
svnadmin dump
Then create a new repository with the trunk directory at the root, and reload the dump with
svnadmin load --parent-dir trunk
If you do an svn move then that will mess things up if you ever update back to a revision before the move, since the files will move back to their previous location, which is probably not what you want.
Used therefromhere's answer, which worked fine, but wanted to add the commands including the parameters, i.e. as executed on the svn server's command line:
Dump your existing repository into a file:
svnadmin dump /path/to/myrepo/ > /some/dir/myproject.svndump
Create a new repository:
svnadmin create /path/to/mynewrepo/
Add the trunk/
folder and commit it, in the working copy directory:
mkdir trunk; svn add trunk; svn commit trunk -m "Add: trunk folder"
Load the dumpfile into the new repository using trunk
as parent-dir
:
svnadmin load --parent-dir trunk /path/to/mynewrepo/ < /some/dir/myproject.svndump
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