如何更改subversion存储库的结构? [英] How to change structure of subversion repository?
问题描述
我是 Subversion 的新手,所以我现在不知道这是一个愚蠢的问题:
I'm a newbie with Subversion, so I don't now if this is a dumb question:
我继承了一个扁平结构的 subversion 存储库,没有/trunk/tags/branches 顶级).
I've inherited a subversion repository with a flat structure with no /trunk /tags /branches top level).
我想重新构建它,使其遵循
I'd like re-structure it so that it follows the
/trunk
/tags
/branches
布局.
这可能吗?
推荐答案
特别是如果您使用的是 Subversion 1.4,请参阅此答案以获取替代方案:
Especially if you're using Subversion 1.4, see this answer for an alternative:
否则,move
是实现重组的最简单方法.正如@JoelFan 所说,move
将在目录上工作,因此您无需工作副本即可执行此操作:
Otherwise, move
is the simplest way to achieve the restructuring. As @JoelFan said, move
will work on directories, so you can perform this operation without a working copy:
svn mkdir --quiet --message "Restructuring" http://svnhost/svnrepos/trunk
svn mkdir --quiet --message "Restructuring" http://svnhost/svnrepos/tags
svn mkdir --quiet --message "Restructuring" http://svnhost/svnrepos/branches
然后,为您的源设置适当的 move
命令:
then, appropriate move
commands for your sources:
svn move --message "Restructuring" http://svnhost/svnrepos/dir01 http://svnhost/svnrepos/trunk/dir01
注意:如果现有存储库具有如下结构:
Note: If the existing repository has a structure like:
/repos
/projectA
/branches
/tags
/trunk
/projectB
/branches
/tags
/trunk
我建议保持这种方式 - 如果出于某种原因您需要这样做,它会使将项目分成单独的存储库非常简单.
I'd suggest leaving it that way - it would make separating the projects into separate repositories very straightforward if for some reason you need to do so.
这篇关于如何更改subversion存储库的结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!