开发者

How to add tags/trunk/branches to established SVN repo?

Lets say you have an established SVN repository with many hundreds of revisions and has been around for upwards of a year. The repository does not have the standard tags, trunk and branches at the top level. Instead it just goes straight into the code.

Is there a way to add in tags, trunk and branches to the repository on the top level without开发者_开发技巧 just checking out the entire repository, altering the directory structure and then committing? Is there anyway to add it in recursively so that if you wanted to view a file from a year ago that used to be here:

svn://svn.server.com/myfolder/myfile.txt

instead you would see it here

svn://svn.server.com/trunk/myfolder/myfile.txt

Is this possible? Or do I just have to check everything out, alter the dir structure at the top and commit the whole thing?


You don't need to check out the repo to manipulate it.

svn mv svn://svn.server.com/myfolder svn://svn.server.com/trunk
svn mkdir svn://svn.server.com/tags svn://svn.server.com/branches

If immediate commits are scary, you might also be interested in svn checkout --depth='immediates' which will checkout only the files and folders in the target directory--not the contents of the folders. Check out the root with --depth=immediates, arrange directory structure as desired, commit.

There isn't a good way to accomplish the recursive change short of rewriting the entire repo's history.


I believe the only way to do this recursively would to use svnadmin dump, alter the dump file, then import to a clean repo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜