I am using Mac OS X 10.7.2 with Git 1.7.8.2 installed using Homebrew, cvsps 2.2b1, and git-cvsimport.
I worked with a Subversion repository of a Web site project sometime ago which I’ve successfully converted into a Git repo. While I haven’t worked on the project, a colleague who could not access and use Subversion, but had the latest checkout, saved his changes in a CVS repository.
I would like to convert his CVS commits and apply them on my Git repo. But I have no experience in CVS; as I only worked with Subversion and Git before.
For now, I’m only trying to convert his CVS repo into Git. (Perhaps I’ll use a git merge or git rebase later to get the converted Subversion and CVS repositories together into one Git repo. But I’m not at that point yet.)
He sent me a compressed tarball of his CVS “repo.” When I untar it, I get one directory matching the name of the project, with files in it matching each file of project, but with a “,v” at the end of each name for versioning. I assume the tarball I got is only a module for a CVS repository, which I think should be sufficient.
Here’s the structure of my files:
- ~/Sites/CVSROOT/
- sitename/
- .cvsignore,v
- index.html,v
- images/
- …
- sitename/
The commands I use to convert the CVS module into a Git repo is the following:
$ cd ~/Sites
$ rm -fr sitename # Make way for new git repo of same name.
$ git cvsimport -v -d ~/Sites -C sitename sitename
This is what it outputs:
Initialized empty Git repository in /Users/remi/Sites/sitename/.git/
Running cvsps...
cvs_direct initialized to CVSROOT /Users/remi/Sites
cvs rlog: Logging sitename
cvs rlog: Logging sitename/.git
cvs rlog: Logging sitename/.git/hooks
cvs rlog: Logging sitename/.git/info
cvs rlog: Logging sitename/.git/objects
cvs rlog: Logging sitename/.git/objects/info
cvs rlog: Logging sitename/.git/objects/pack
cvs rlog: Logging sitename/.git/refs
cvs rlog: Logging sitename/.git/refs/heads
cvs rlog: Logging sitename/.git/refs/tags
DONE; creating master branch
fatal: refs/heads/origin: not a valid SHA1
fatal: master: not a valid SHA1
fatal: You are on a branch yet to be born
checkout failed: 32768
When I get into the directory of the new Git repo, doing git log yields fatal: bad default revision 'HEAD'.
Is there something I’m missing? Are there other files I need from my colleague’s CVS repo server?
Thanks in advance for your help!
I suggest to use this http://cvs2svn.tigris.org/cvs2git.html. cvsps is not supported – doesnt work with branches and just plain old doesnt work IMHO