如何向已建立的 SVN 存储库添加标签/主干/分支?
假设您有一个已建立的 SVN 存储库,有数百个修订版本,并且已经存在一年多了。存储库在顶层没有标准标签、主干和分支。相反,它只是直接进入代码。
有没有办法将 tags
、trunk
和 branches
添加到顶层的存储库,而无需仅检查整个存储库,更改目录结构然后提交?无论如何,是否可以递归地添加它,以便如果您想查看一年前曾经在这里的文件:
svn://svn.server.com/myfolder/myfile.txt
而不是您会在这里看到它
svn://svn.server.com/trunk/myfolder/myfile.txt
这可能吗?或者我只需要检查所有内容,更改顶部的目录结构并提交整个内容?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不需要检查存储库来操作它。
如果立即提交令人恐惧,您可能还会对 svn checkout --depth='immediates' 感兴趣,它只会检出目标目录中的文件和文件夹,而不检出文件夹的内容。使用
--depth=immediates
检查根目录,根据需要安排目录结构,然后提交。除了重写整个存储库的历史之外,没有什么好方法可以完成递归更改。
You don't need to check out the repo to manipulate it.
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.
我相信递归执行此操作的唯一方法是使用 svnadmin dump,更改转储文件,然后导入到干净的存储库。
I believe the only way to do this recursively would to use svnadmin dump, alter the dump file, then import to a clean repo.