tags:

views:

800

answers:

5

Hi,

Is is possable to change the directory structure of an existing SVN repository?

I have the following structure:

\trunk

\branches

\releases

I would like to change the \releases folder to \tags

Cheers Sean

+1  A: 
svn mv releases/ tags/
svn commit -m "move releases/ to tags/"

Then if you want to recreate the releases folder

svn mkdir releases
svn commit -m "recreate releases folder"
Andrew Austin
+2  A: 

Sure - they're just directories. Just do

svn move releases tags

or use a visual SVN client to do the moving, like SmartSVN

Artem Russakovskii
This does require a working copy with releases and tags as sub-folders, as well as a commit afterwards
crashmstr
I don't understand SO sometimes, I answer a question first, somebody else later responds saying exactly the same thing I do, and then they get upvoted. :)
Andrew Austin
I actually prefer checking out, doing things, then checking in because 1. You can make multiple changes and commit in one go and 2. You will see the changes done before they go live
Artem Russakovskii
Andrew, maybe they think you smell bad :) or someone is a fan of SmartSVN, like me.
Artem Russakovskii
A: 

The "rename" command is probably what you need. It will keep revision history and allow you to change directories of files.

sangretu
Funny, I gave this answer to another question a while back which I had misread as being pretty much this quesion. http://stackoverflow.com/questions/1009314/copy-part-of-svn-repo-to-new-repo/1009343#1009343
sangretu
rename and move is the same thing
Artem Russakovskii
Is it? Perhaps I was confusing move with "relocate".
sangretu
+1  A: 

If you want to do this on a working copy that has all of those checked out from the root, then the answers from Andrew and Artem are fine. Don't forget to commit the change!

I don't like to have all of my tags checked out, so in that case, you would need to use URL parameters.

For example:

svn move svn://svnmachine/repository/release svn://svnmachine/repository/tags

FYI: mv, rename, move, and ren are all the same command, which are equivalent to a copy and delete.

Help on svn move command

crashmstr
+3  A: 

No problem, use svn move. You can do the move locally and then do a checkin (it requires you to checkout the whole svn repository in this case).

You can also do the move remotely:

svn move svn+ssh:user@host//myrepo/releases svn+ssh:user@host//myrepo/tags

If you are using TortoiseSVN, you can do this action when browsing the repository.

Bluebird75
Thanks, I used the repository browser on TortoiseSVN to rename the folder, didnt relise that it could be done from there.
Sean Taylor