【问题标题】:Migration From CVS to GIT从 CVS 迁移到 GIT
【发布时间】:2015-02-24 10:53:39
【问题描述】:

我正在尝试从 CVS 迁移到 git。 运行 git cvsimport 命令时出现以下错误。

c:\Users\cvsps-2.1.tar\cvsps-2.1\cvsps-2.1>git cvsimport -C -d $CVSROOT
cvs_direct: cvs server too old for cvs_direct
WARNING: Your CVS client version:
[Client: Concurrent Versions System (CVS) 1.11.17 (client/server)]
and/or server version:
[Server: Concurrent Versions System (CVS) 1.11 (client/server)]
are too old to properly support the rlog command.
This command was introduced in 1.11.1.  Cvsps
will use log instead, but PatchSet numbering
may become unstable due to pruned empty
directories.

cvs log: in directory .:
cvs [log aborted]: there is no version here; run 'cvs checkout' first
can't open cvsps.cache for write: No such file or directory
fatal: refs/heads/origin: not a valid SHA1
fatal: master: not a valid SHA1
warning: You do not appear to currently be on a branch.
warning: Forcing checkout of HEAD.
fatal: just how do you expect me to merge 0 trees?
checkout failed: 256

我已经设置的 CVSROOT。 由于服务器的 cvs 版本是 1.11,而客户端的版本是 1.11.17,所以错误来了。

任何帮助将不胜感激。

【问题讨论】:

  • 你好 xlembouras。你编辑过什么吗?
  • 首先通过 cvs checkout ("cvs -d $CVSROOT co") 测试您的 CVSROOT 的健全性。
  • 在运行 cvs co -d $CVSROOT 时出现错误,必须指定 1 个模块或目录。我已经给出了我在 cvs 中的项目名称之一,但错误仍在发生。
  • 您好,我可以查看项目。

标签: git cvs


【解决方案1】:

看看cvs-fast-export。 (另请参阅manual page。)制作存储库的副本(只是为了确定)并让cvs-fast-export 处理。

它不需要 CVS 服务器,而是直接在存储库中的 RCS 文件上工作,就像这样;

cp -Rp repo/ test
cd test
echo RCS >.gitignore
git init
find . | cvs-fast-export -A ~/authormap | git fast-import
git add .
git commit -m "Imported into git."

如果您需要从远程存储库中获取数据,请使用cvssync。来自 cvs-fast-import 手册页的示例:

cvssync anonymous@cvs.savannah.gnu.org:/sources/groff groff
find groff | cvs-fast-export >groff.fi

【讨论】:

    【解决方案2】:

    我可以回答“如何将 CVS 迁移到 git 一次并完成”的问题(但无法解释您报告的错误)。

    请参阅这篇 SO 文章 How to import CVS to git scm? 和 cvsimport 命令的 Git 文档。两者都强烈建议使用 cvs2git 或 parsecvs(而不是 git cvsimport)进行一次性迁移。

    我试过 cvs2git - 从http://cvs2svn.tigris.org/cvs2git.html 下载。这些命令有点毛茸茸,但它起作用了。快速入门:

    % cvs2svn-2.4.0/cvs2git --blobfile=blob.dat --dumpfile=dump.dat --username=cvs2git /path/to/cvsroot/project/ 
    % git init --bare project.git
    % cd project.git
    % cat ../blob.dat ../dump.dat | git fast-import
    

    【讨论】:

    • 但我猜想使用 cvs2git cvs 存储库必须在您的本地计算机中。我只有 apserver 访问我的 CVS 存储库。
    • 我正在尝试将我的项目从 cvs 迁移到 git。我尝试了 git-cvsimport 和 cvs2git 命令行工具,但没有成功。对于 cvs2git,我运行了下面的命令。 $ cvs2git --blobfile=c:\blobData.dat --dumpfile=c:\dumpData.dat --username=NiharRanjan.Behera C:\MigrationCVS\LocalRepoCVS\CVSROOT;但它什么也没做。它只是去一个新的 kine 而没有做任何事情。意味着我猜该命令没有运行。我正在使用 windows。任何帮助将不胜感激。
    【解决方案3】:

    您服务器上的 CVS 版本是上个世纪发布的。这就是问题所在!

    大约 14 年前,第一个带有 cvs rlog 命令的 CVS 版本发布了。这个版本应该可以正常工作了,早就应该升级了。

    由于您想摆脱 CVS,我建议您以任何可能的方式正确备份您的 CVS 存储库,包括愤怒的电话,并使用许多可用工具中的任何一种进行转换。

    如果没有人在听,你可以试试cvssucks,但它非常很慢。

    git cvsimport 使用的cvsps 命令应该能够从您的存储库中获取补丁集合,即使它很旧;但是,将它们重新组合起来会很乏味。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-27
      • 2011-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多