2011-10-03 40 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. 實際上實現了錯誤消息中提到的鉤子,但它有點棘手,我不認爲你會再次需要工作樹。