gpt4 book ai didi

git - 将具有多个模块的 CVS 项目转换为一个 git 存储库的最佳方法是什么?

转载 作者:太空狗 更新时间:2023-10-29 14:20:39 28 4
gpt4 key购买 nike

我继承了一个由许多模块组成的旧 CVS 项目。这种分成模块主要是历史的,逻辑上它们属于一起。我想将它切换到 GIT 项目。 git cvsimport 似乎仅限于转换一个模块,但我不想为 CVS 模块使用 GIT 子模块 - 开销太大。

我简要地研究了 cvs2git - 它似乎可以工作,但它为标签创建了许多虚假提交(好吧,一些 CVS 标签没有覆盖整个 CVS 源代码树)。

我听说过的另一个工具是 tailor - 但我根本无法使用它。

还有其他建议吗?

最佳答案

看起来最好的机会是在 CVSROOT/modules 中声明一个根模块并引用它下面的所有其他模块:

#M  everything  Composite module which holds all other submodules
everything &foo \
&bar \
&baz

– 然后照常调用 git-cvsimport:

git cvsimport -k -A authors everything -C my-git-repo

不过,这种方法并不总是对我有效(我收到已知错误消息 警告:文件 foo 不匹配 strip_path bar ignoring)。这是 Jeff King suggests 的内容:

As a hack, if you can move files in the CVS repository (and if you can't, try using cvssuck or similar to pull them locally, and then do the import from there), then move everything to a submodule "foo", and import that module.

Alternatively, you might check out some of the alternative importers like parsecvs or cvs2git. I don't know if they would handle this situation better.

And as a super-hacky alternative, you could import each module separately and then stich them all together using git-filter-branch.

因为 git-cvsimport 似乎是唯一支持作者映射的实用程序,我建议您在存储库中移动文件,然后使用 git-cvsimport 导入单个模块。

关于git - 将具有多个模块的 CVS 项目转换为一个 git 存储库的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12954572/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com