Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN -Change directory structure on an existing repository

Tags:

svn

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

like image 680
Sean Taylor Avatar asked Jun 18 '09 14:06

Sean Taylor


People also ask

How do I find my svn repository path?

You need to find the virtual host in your apache configuration and look for a <Location> section that matches your url path and look for a SVNPath or SVNParentPath config line. This will tell you the location of your subversion repository.

Does svn have branching?

SVN's “branch” directory runs parallel to the “trunk” directory. A SVN branch copies the trunk and allows you to make changes. When the new feature is stable, the branch is merged back. Here's a basic step-by-step overview of SVN branching and merging.


5 Answers

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.

like image 138
Philippe F Avatar answered Nov 01 '22 04:11

Philippe F


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

like image 30
crashmstr Avatar answered Nov 01 '22 05:11

crashmstr


Sure - they're just directories. Just do

svn move releases tags

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

like image 34
Artem Russakovskii Avatar answered Nov 01 '22 06:11

Artem Russakovskii


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"
like image 37
Andrew Avatar answered Nov 01 '22 06:11

Andrew


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

like image 1
sangretu Avatar answered Nov 01 '22 06:11

sangretu