cvsimport后git出了问题

时间:2011-10-03 07:49:58

标签: git

我目前正在尝试将我们的cvs存储库迁移到git,因此需要所有旧数据,但我遇到了一些问题。

导入作品。

首先使用cvs init

中的CVSREPOLOCAL制作本地简历

从旧驱动器复制projectname,然后

git cvsimport -d /home/git/CVS_REPOLOCAL projectname -C projectname.git

gitosis还配置为允许写入projectname

[group projectname]
members joe jim tom bart
writable = projectname

在本地机器上:

git clone ssh://git@server/projectnane.git

更改文件并执行:

git commit -a
[master 8a3d0f7] test
1 files changed, 1 insertions(+), 1 deletions(-)

gitk显示我的更改为新主人

...但是在尝试为项目中的其他人提供更改时:

git push
Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 432 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error: 
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error: 
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh://git@k.....git
 ! [remote rejected] master -> master (branch is currently checked out)

有没有办法保留旧的导入数据,仍然可以为多个用户获取ssh gitosis?

我有一个正在运行但没有cvs导入所以不是解决方案:(

1 个答案:

答案 0 :(得分:0)

您有三种选择:

  1. 使用一个存储库进行导入,另一个存储区(无工作副本)用于中心位置。将代码从您导入cvs的代码推送到裸代码。我认为这是最干净的选择。我甚至会争论在你的工作站而不是服务器上进行导入,并在切换完毕后将其丢弃。
  2. 在存储库(git checkout HEAD@{0})上分离头或查看另一个分支(git checkout -b cvsimport)。
  3. 实际上实现错误消息中提到的钩子,但它有点棘手,我认为你实际上不会再需要工作树了。