VCS 迁移到 Git - 我的方法如何?

发布于 2024-11-07 09:52:09 字数 406 浏览 3 评论 0原文

我刚刚继承了一个使用 SVN for VCS 的大型 Web 项目。没有分支机构,该项目在过去四个月里已经被放弃了——它相当稳定。

我计划趁有机会时将 SVN 迁移到 Git(使用 gitosis)——因此我会将 SVN 历史记录转换到我正在部署的新 Git 存储库的主分支中。

感谢这里的无数其他问题,我肯定已经涵盖了这一部分 - 从那里,我计划为每个开发阶段创建一个分支 - alpha、dev、stage 和 prod,并让这些服务器拉动 它们“所属”的分支。我还计划向上合并(提交到 alpha、与 dev 合并、与 stage 合并等)并推送到 prod。

我认为这是针对这种环境的最佳计划,但我想知道在开始之前是否有任何陷阱或我应该注意的事情。非常感谢您的见解!

I just inherited a large web project using SVN for VCS. There are no branches, and the project has been abandoned for the past four months - it's pretty stable.

I plan on migrating the SVN to Git (using gitosis) while I have the opportunity - so I'll be converting the SVN history into the master branch of the new Git repository I'm putting in place.

Thanks to a myriad of other questions here, I definitely have that part covered - from there, I plan to create a branch for each stage of development - alpha, dev, stage, and prod, and have those servers pull the branches that they "belong" to. I also plan on merging upwards (commit to alpha, merge with dev, merge with stage, so on) and pushing to prod.

I think this is the best plan for this kind of environment, but I'm wondering if there are any gotchas or anything that I should be aware of before I get started. Your insight is much appreciated!

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

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

发布评论

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

评论(2

浅忆 2024-11-14 09:52:09

您可以考虑:

  • 使用 gitolite 而不是过时的 gitosis(用于授权层)
  • 创建多个 Git 存储库隔离初始 SVN 存储库的相关子集。
  • 考虑到身份和授权方面 DVCS 中不存在:即使您正在映射 SVN 用户以进行迁移(如 manojlds他的答案),没有什么可以阻止他们提交他们想要的任何“user.name”一次他们正在使用新的 Git 存储库。

You could consider:

  • using gitolite instead of the obsolete gitosis (for the authorization layer)
  • creating several Git repo for isolating coherent subset of the initial SVN repo.
  • taking into account the identification and authorization aspects which don't exist with a DVCS: even if you are mapping your SVN users for the migration (as described by manojlds in his answer), nothing prevent them to commit with any 'user.name' they want once they are working with the new Git repo.
这个俗人 2024-11-14 09:52:09

一件事是您必须有一个作者映射文件,它将 SVN 用户名应用到包含用户名和电子邮件的 Git 用户。有一些脚本可以生成这样的作者文件,例如:

svn log | grep -E "r[0-9]+ \| .+ \|" | awk '{print $3}' | sort | uniq

您可以使用 svn2git 进行转换。

但我认为您可能已经涵盖了上述两种方法或有其他方法,但只是作为作者文件提及可能在很多地方都没有提及。

您还可以查看 git-flow 来建立您和您团队的工作流程。

One thing is that you must have a authors map file that will app SVN usernames to Git users with username and email. There are scripts to generate such an authors file, something like:

svn log | grep -E "r[0-9]+ \| .+ \|" | awk '{print $3}' | sort | uniq

You can make use of svn2git for the conversion.

But I think you might have the above two covered or have other ways of doing it, but just mentioning as the authors file might not be mentioned in many places.

You can also look into git-flow for establishing your and your team's workflow.

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