2011-10-03 37 views
1

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

导入作品。

首先要使用cvs init本地CVS在CVSREPOLOCAL

复制从旧的驱动器,然后

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

的gitosis也被配置为允许写入projectname

[group projectname] 
members joe jim tom bart 
writable = projectname 
projectname有本地计算机上的

git clone ssh://[email protected]/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://[email protected] 
! [remote rejected] master -> master (branch is currently checked out) 

有没有办法保持旧的导入数据,仍然为多个用户获得ssh gitosis?

我有一个运行,但没有的CVS导入这样不是办法:(

+0

嗨,

感谢您的快速响应。
我从CVS再次导入后尝试过这种
MV projectname.git项目名称
混帐克隆--bare项目名称projectname.git

现在我可以推,从本地机器拉。

这是一个好方法吗?

gery

回答

0

你有三个选择:

    为进口和另一个,裸露(无工作拷贝)
  1. 使用一个仓库的一个对于中央的地方,将代码从你导入CVS的代码推送到空白代码,我认为这是最干净的选项,我甚至会争辩说,在你的工作站上而不是服务器上导入并丢弃它一次交换机全部结束
  2. 分离存储库中的头(git checkout [email protected]{0})或检查从另一个分支(git checkout -b cvsimport)。
  3. 实际上实现了错误消息中提到的钩子,但它有点棘手,我不认为你会再次需要工作树。