简体   繁体   中英

How to import CVS to git scm?

In order to import a revision of a CVS module, I am using:

/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. How do I determine what the cvsps error is?

Gave up on this approach and have used cvs2git .

The cvs2git is a tool that can be used to migrate CVS repositories to newer version control tools, including 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

WARNING: git cvsimport uses cvsps version 2, which is considered deprecated; it does not work with cvsps version 3 and later. If you are performing a one-shot import of a CVS repository consider using cvs2git or parsecvs.

Check if you have a cvsps version 3 or later

$ cvsps --version

If you can downgrade it to cvsps version 2 you are done.

Main difference is cvs2git is not incremental (except using this workaround), so it's targeted to one-shot checkout. With cvsimport you can do incremental updates, and stay up to date to cvs repo.

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.

On OSX you can (having brew ):

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

Try cvs-fast-export first:

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

It will fail cleanly in some weird cases. If that happens, try 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.

Don't use git-cvsimport or either version of cvsps - they suck pretty badly, and will probably misplace your branch joins. I was the person responsible for the cvsps-3.x releases; I deep-sixed that code in favor of what became cvs-fast-export.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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