具有历史记录的存储库之间的 SVN 复制

发布于 2024-07-23 04:57:14 字数 294 浏览 2 评论 0原文

我的一位队友询问是否可以从一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

拥抱影子 2024-07-30 04:57:14

[编辑:下面的原始回复来自 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 the svnrdump 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.

君勿笑 2024-07-30 04:57:14

通常实现此目的的方法是 <代码>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.

彩扇题诗 2024-07-30 04:57:14

我有类似的需求(因此访问了此页面)并最终编写了自己的程序来完成这项工作。 认为该工具可能对仍在寻找解决方案的其他人有用:

  • 该工具不需要对源存储库的管理员访问权限。
  • 它支持添加/删除/复制/移动,保留节点属性(例如 svn:ignore、svn:external)和修订属性(即,您获得正确的作者和日期/时间)。
  • 还可以增量复制新的修订版本。
  • 具有 GUI 和命令行实用程序。

如果有人感兴趣,请查看此处

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:

  • The tool needs no admin access to the source repository.
  • It supports add/delete/copy/move, preserves node property (e.g. svn:ignore, svn:external) and revision property (i.e., you get the correct author and date/time).
  • Can also incrementally copy new revisions.
  • Has both GUI and a command line utility.

If anybody is interested, check it out here

风筝有风,海豚有海 2024-07-30 04:57:14

您可以使用 git-svn (或者可能是另一个 SCM 系统)来完成此任务。

步骤如下:

1. Get a git svn clone of each repository:
    git svn clone <SVN-REPOSITORY-FROM> source-repo
    git svn clone <SVN-REPOSITORY-TO> dest-repo

 2. Create patches to be imported:
    cd source-repo/
    export commitFrom=`git log --pretty=%H | tail -1`
    git format-patch -o /tmp/mergepatchs ${commitFrom}..HEAD .

 3. Import the patches
    cd dest-repo/
    git am /tmp/mergepatchs/*.patch

参考: 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:

1. Get a git svn clone of each repository:
    git svn clone <SVN-REPOSITORY-FROM> source-repo
    git svn clone <SVN-REPOSITORY-TO> dest-repo

 2. Create patches to be imported:
    cd source-repo/
    export commitFrom=`git log --pretty=%H | tail -1`
    git format-patch -o /tmp/mergepatchs ${commitFrom}..HEAD .

 3. Import the patches
    cd dest-repo/
    git am /tmp/mergepatchs/*.patch

Referenced: http://blog.neutrino.es/2012/git-copy-a-file-or-directory-from-another-repository-preserving-history/

故人爱我别走 2024-07-30 04:57:14

如果您只需要具有完整变更集的版本控制存储库,则可以将 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文