具有历史记录的存储库之间的 SVN 复制
我的一位队友询问是否可以从一个 SVN 导出到另一个 SVN,同时保留历史记录。
对我来说,这似乎是一个常见的要求。
那么:是否可以在保留历史记录的同时在 SVN 存储库之间进行迁移?
需要注意的是,我们在源上没有 svnadmin 访问权限,但在目标上有该权限。
如果这归结为只是从源检查每个修订并将其签入目标,那么只要有一个自动化流程,我们就可以接受。
编辑:我忘了提及目标存储库位于 Windows 上。
One of my teammates has asked if it is possible to export from one SVN to another, all while maintaining history.
To me, this seems like it would be a common request.
So: Is it possible to migrate between SVN repositories all while maintaining history?
It is important to note that we do not have svnadmin access on the Source, but we do have that on the Destination.
If this comes down to just checking out each revision from the source, and checking it in to the destination, we would be OK with that, as long as there was an automated process for that.
EDIT: I forgot to mention that the destination repo is on windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
[编辑:下面的原始回复来自 SVN 1.7 之前的版本,这是解决问题的最佳方法(尽管它不是 svnsync 的主要用例) 。 在 SVN 1.7 客户端或更高版本中,有
svnrdump
工具可以更直接地完成您想要实现的目标)]使用 svnsync 将源同步到目标(需要目标存储库的管理员访问权限或至少需要一种添加挂钩的方法,但对源存储库没有特殊访问权限)。 如果目标已有修订,请将源同步到临时存储库,然后使用
svn-merge-repos.pl
合并两个本地存储库。[Edit: The original reply below is from pre SVN 1.7, and there this was the best way to solve the problem (although it is not the primary use case of
svnsync
). In SVN 1.7 client or later there is thesvnrdump
tool that does more directly what you are trying to achieve)]use svnsync to synchronize the source to the destination (needs admin access to the destination repository or at least a way to add hooks, but no special access to the source repository). If the destination already has revisions, sync the source to a temporary repository, and then use
svn-merge-repos.pl
to merge the two local repositories.通常实现此目的的方法是 <代码>svnadmin dump命令。 如果您没有 svnadmin 访问权限,那么我会询问拥有 svnadmin 访问权限的人是否可以为您提供转储。 这也将使导入过程变得更加容易。
您当前在共享存储库上吗? 这可能会让拥有存储库的人不愿意向您提供转储,因为它将是整个存储库的副本,而不仅仅是您的一部分。
The way to typically achieve this is the
svnadmin dump
command. If you don't have svnadmin access then I would ask the person that does if they can supply you with a dump. This will make the process of importing much easier as well.Are you on a shared repository currently? This might make the person that owns the repository leary of giving you a dump, since it will be a copy of the entire repository, not just your piece of it.
我有类似的需求(因此访问了此页面)并最终编写了自己的程序来完成这项工作。 认为该工具可能对仍在寻找解决方案的其他人有用:
如果有人感兴趣,请查看此处
I had a similar need (hence visited this page) and ended up writing my own program to do the work. Thought the tool may be useful to others who are still looking for a solution:
If anybody is interested, check it out here
您可以使用 git-svn (或者可能是另一个 SCM 系统)来完成此任务。
步骤如下:
参考: http: //blog.neutrino.es/2012/git-copy-a-file-or-directory-from-another-repository-preserving-history/
You can use git-svn (or perhaps another SCM system) to accomplish this task.
The steps would be:
Referenced: http://blog.neutrino.es/2012/git-copy-a-file-or-directory-from-another-repository-preserving-history/
如果您只需要具有完整变更集的版本控制存储库,则可以将 bzr 与 bzr-svn 插件一起使用。
当您签出 svn 存储库时,所有内容都会同步。
If you need only a version control repo with full changeset, you can use bzr with bzr-svn plugin.
When you checkout a svn repo, everything will be syncronized.