将目录迁移到不同的 svn 存储库
我在 svn 存储库中有代码,将其称为存储库 A。现在假设我需要将内容移动到存储库 B,但存储库 B 已经对其他项目处于活动状态一段时间了。是否可以将特定目录从存储库 A 移动到存储库 B,同时保留文件历史记录?通常,要将整个存储库迁移到新服务器,我会这样做:
svnadmin dump -r 0:179 rep_a > rep_a.dump
svnadmin create rep_b
svnadmin load rep_b < rep_a.dump
但是,这会作用于整个存储库,并假设存储库 B 一开始是空的(我认为)。我当然可以导出有问题的目录并将其导入存储库 B,但我丢失了版本历史记录。
有没有一种简单的方法可以将特定目录从 A 移动到 B 而不会丢失版本历史记录?
I have code in an svn repository, call it repository A. Now say that I need to move the contents to repository B, but repository B has already been active for a while for other projects. Is it possible to move a particular directory from repository A to repository B, preserving the file history? Normally, to migrate an entire repository to a new server, I would do:
svnadmin dump -r 0:179 rep_a > rep_a.dump
svnadmin create rep_b
svnadmin load rep_b < rep_a.dump
However, this acts on the whole repository and assumes repository B is empty to start with (I think). I can of course export the directory in question and import it into repository B, but I lose the version history.
Is there an easy way to move a particular directory from A to B without losing the version history?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您要将
rep_a
的trunk/project
目录复制到rep_b
中,则必须使用以下命令:与
相关的修订rep_a
将被添加到rep_b
的历史记录中。当然,要小心并提前做好备份。此外,如果您有公共目录,那么您将必须从转储中删除目录创建(以避免创建相同的目录两次),这可能会很棘手。
Let's say you want to copy directory
trunk/project
ofrep_a
intorep_b
, you have to use this command:The revisions related to
rep_a
will be added to the history ofrep_b
.Be careful with that and make a backup before, of course. Also, it can be tricky if you have common directories, then you will have to remove directory creations from the dump (to avoid creating the same directories twice).
查看过滤存储库历史记录 在 SVN 书中。
Look at Filtering Repository History in the SVN book.