如何从我的 SVN 存储库中提取一个子树到一个新的? [英] How can I extract a subtree from my SVN repository into a new one?
问题描述
我们有一个 Subversion 存储库,其中有一个目录:
We have a Subversion repository with one directory that is:
- 实际上不需要超出 RCS 功能的修订控制
- 未与存储库中的任何其他内容一起进行版本控制
- 修改频率约为存储库其余部分的六倍
虽然我知道高修订号不是问题,但我还是想将这个单一目录从我的主存储库中提取出来,放到第二个目录中,最好是新的.
Although I know that high revision numbers aren't a problem, nonetheless I'd like to pull this one single directory out of my main repository and into a second, ideally new one.
最好的流程是什么?如果它有所作为,则 SVN 存储库托管在(...检查...)FreeBSD 机器上.
What is the best process for that? If it makes a difference, the SVN repository is hosted on a (... checks... ) FreeBSD machine.
值得注意的是,虽然我需要在新仓库中保留版本历史,但没有必要删除旧仓库中的内容;它可以坐在那里,尽管我很在意.
It's worth noting that while I need to retain the version history in the new repository, there's no need to obliterate the content in the old; it can just sit there, for all I care.
推荐答案
您可以使用 svnadmin dump 和 svnadmin load 从原始存储库创建一个新存储库;然后将不适合您的方案的目录复制到更好的位置,然后删除其他所有内容.在原始存储库中,您只需删除不合适的目录.这将保持所有历史记录完整无缺,最终您将拥有两个存储库.
You could use svnadmin dump and svnadmin load to create a new repository from the original one; then copy the directory that doesn't really fit into your scheme to a better location, then delete everything else. In the original repository you would simply delete the non-fitting directory. This keeps all history intact, and you end up with two repositories.
可能有一种方法可以随后从历史记录的无用部分中清除两个存储库 (svndumpfilter),但由于硬盘空间非常便宜,我认为没有必要这样做.无论如何,SVN 文档 有关于它的所有信息.
There is probably a way to subsequently clean both repositories from the then useless parts of the history (svndumpfilter), but since hard disc space is quite cheap I wouldn't think this necessary. Anyway, the SVN documentation has all the information about it.
这篇关于如何从我的 SVN 存储库中提取一个子树到一个新的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!