我可以使用 Git 在具有历史记录的 svn 存储库之间移动文件吗?

发布于 2024-08-10 18:08:33 字数 136 浏览 3 评论 0原文

我一直在使用 git-svn 来处理 svn 存储库 A,现在我需要将项目移至存储库 B。我可以使用 svn 从 A 导入最新的 HEAD。但我想保留历史记录如果有办法的话。有办法做到这一点吗?我可以将 repos b 添加为远程分支并提交给它吗?没有把握。

I've been using git-svn to work with svn repository A, and now I need to move the project over to repository B. I could just use svn to import the lastest HEAD from A. But I'd like to preserve the history if there's a way. Is there a way to do this? Can I add repos b as a remote branch and dcommit to it or something? Not sure.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

原谅我要高飞 2024-08-17 18:08:33

您可以为 git 使用一些特殊的 svn 插件,但最好使用 Subversion 自己的工具。

Subversion FAQ 有一个关于此的条目:如何合并两个完全独立的存储库?

简单的转储/加载方式曾经对我来说效果很好,但我当然建议在进行合并之前创建一个备份。

You could using some special svn plugins for git but it's better to use Subversion's own tools for that.

The Subversion FAQ has an entry about this: How do I merge two completely separate repositories?

The simple dump/load way worked for me once quite well but I'd certainly suggest to create a backup before doing this merge.

信仰 2024-08-17 18:08:33

git svn 文档中,有一个关于 dcommit 的注释 -- commit-url 选项(强调我的):

这是为了允许使用一种传输方法(例如 svn://http:// 用于匿名读取)创建的现有 git svn 存储库在以下情况下可以被重用:用户稍后可以访问备用传输方法(例如svn+ssh://https://)进行提交。 强烈建议不要将此选项用于任何其他目的(不要询问)。

您可能已经发现了“不要询问”部分所指的含义。

In the git svn docs, there is a note for the dcommit --commit-url option (emphasis mine):

This is intended to allow existing git svn repositories created with one transport method (e.g. svn:// or http:// for anonymous read) to be reused if a user is later given access to an alternate transport method (e.g. svn+ssh:// or https://) for commit. Using this option for any other purpose (don't ask) is very strongly discouraged.

It's possible that you've discovered what the "don't ask" part of this is referring to.

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