为什么“git cvsimport”是只返回一个空的 Git 存储库?

发布于 2024-12-29 12:07:59 字数 1808 浏览 0 评论 0原文

我使用的是 Mac OS X 10.7.2,并通过 Homebrew、cvsps 2.2b1 和 git-cvsimport 安装了 Git 1.7.8.2。

不久前,我使用了一个网站项目的 Subversion 存储库,并已成功将其转换为 Git 存储库。虽然我没有参与该项目,但一位同事无法访问和使用 Subversion,但有最新的结帐,将他的更改保存在 CVS 存储库中。

我想转换他的 CVS 提交并将其应用到我的 Git 存储库上。但我没有CVS的经验;因为我之前只使用过 Subversion 和 Git。

目前,我只是尝试将他的 CVS 存储库转换为 Git。 (也许我稍后会使用 git merge 或 git rebase 将转换后的 Subversion 和 CVS 存储库合并到一个 Git 存储库中。但我还没有到那一步。)

他向我发送了一份他的 CVS“存储库”的压缩 tarball。 ”当我解压它时,我得到一个与项目名称匹配的目录,其中的文件与项目的每个文件匹配,但每个名称末尾都有一个“,v”用于版本控制。我认为我得到的 tarball 只是 CVS 存储库的一个模块,我认为这应该足够了。

这是我的文件的结构:

  • 〜/ Sites / CVSROOT /
    • 网站名称/
      • .cvsignore,v
      • index.html,v
      • 图片/
      • ...

我用来将 CVS 模块转换为 Git 存储库的命令如下:

$ cd ~/Sites
$ rm -fr sitename # Make way for new git repo of same name.
$ git cvsimport -v -d ~/Sites -C sitename sitename

这就是它的输出:

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

当我进入新的目录时Git repo,执行 git log 会产生 fatal: bad default revision 'HEAD'

我有什么遗漏的吗?我还需要从同事的 CVS 存储库服务器获取其他文件吗?

预先感谢您的帮助!

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/
      • ...

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

隔岸观火 2025-01-05 12:07:59

我建议使用这个http://cvs2svn.tigris.org/cvs2git.html。不支持 cvsps - 不适用于分支,而且普通旧的不起作用恕我直言

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文