简体   繁体   English

如何将 CVS 导入 git scm?

[英]How to import CVS to git scm?

In order to import a revision of a CVS module, I am using:为了导入 CVS 模块的修订版,我使用:

/usr/lib/git-core/git-cvsimport -a -i -p r,revisionname -k -v -d :pserver:user@xxx.com:2401/srv/cvs/rootname modulename

It works for a while and then I get something like cvsps got an error.它工作了一段时间,然后我得到类似 cvsps 出错的信息。 How do I determine what the cvsps error is?我如何确定 cvsps 错误是什么?

Gave up on this approach and have used cvs2git .放弃了这种方法并使用了cvs2git

The cvs2git is a tool that can be used to migrate CVS repositories to newer version control tools, including git. cvs2git是一个工具,可用于将 CVS 存储库迁移到更新的版本控制工具,包括 git。

Sample usage:示例用法:

cvs2git \
    --blobfile=cvs2git-tmp/git-blob.dat \
    --dumpfile=cvs2git-tmp/git-dump.dat \
    --username=cvs2git \
    /path/to/cvs/repo

From http://git-scm.com/docs/git-cvsimport来自http://git-scm.com/docs/git-cvsimport

WARNING: git cvsimport uses cvsps version 2, which is considered deprecated;警告:git cvsimport 使用 cvsps 版本 2,它被认为是不推荐使用的; it does not work with cvsps version 3 and later.它不适用于 cvsps 版本 3 及更高版本。 If you are performing a one-shot import of a CVS repository consider using cvs2git or parsecvs.如果您正在执行 CVS 存储库的一次性导入,请考虑使用 cvs2git 或 parsecvs。

Check if you have a cvsps version 3 or later检查您是否有 cvsps 版本 3 或更高版本

$ cvsps --version

If you can downgrade it to cvsps version 2 you are done.如果您可以将其降级到 cvsps 版本 2,那么您就完成了。

Main difference is cvs2git is not incremental (except using this workaround), so it's targeted to one-shot checkout.主要区别是cvs2git不是增量的(除了使用这个解决方法),所以它的目标是一次性结账。 With cvsimport you can do incremental updates, and stay up to date to cvs repo.使用cvsimport您可以进行增量更新,并保持最新的 cvs 存储库。

You may downgrade it to cvsps-2.1 and re-test, as git cvsimport doesn't work properly with cvsps-3.x , because it has different syntax.您可以将其降级到cvsps-2.1并重新测试,因为git cvsimport无法与cvsps-3.x正常工作,因为它具有不同的语法。

On OSX you can (having brew ):在 OSX 上你可以(有brew ):

brew tap homebrew/versions
brew install cvsps2
brew unlink cvsps
brew link --overwrite cvsps2

Try cvs-fast-export first:首先尝试 cvs-fast-export:

http://www.catb.org/esr/cvs-fast-export/ http://www.catb.org/esr/cvs-fast-export/

It will fail cleanly in some weird cases.在一些奇怪的情况下,它会彻底失败。 If that happens, try cvs2git.如果发生这种情况,请尝试 cvs2git。 You don't want to go with cvs2git first, as it is extremely slow, generates results in an inconvenient format, doesn't convert cvsignore files, and has several other minor problems as well.您不想首先使用 cvs2git,因为它非常慢,生成格式不方便的结果,不转换 cvsignore 文件,并且还有其他几个小问题。

Don't use git-cvsimport or either version of cvsps - they suck pretty badly, and will probably misplace your branch joins.不要使用 git-cvsimport 或任何一个版本的 cvsps - 它们非常糟糕,并且可能会放错你的分支连接。 I was the person responsible for the cvsps-3.x releases;我是 cvsps-3.x 版本的负责人; I deep-sixed that code in favor of what became cvs-fast-export.我对该代码进行了深度修改,以支持成为 cvs-fast-export 的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM