2012-03-30 369 views
1

幾個月前,我設法運行cvs2git併爲某些代碼創建了git存儲庫。我從CVS導入到我想用作遠程存儲庫的專用服務器中。將從cvs2git創建的存儲庫轉換爲裸存儲庫

今天,我第一次嘗試從遠程存儲庫克隆,並能夠成功克隆。然而,當我試圖將更改備份到遠程倉庫,好像這不是裸露的,因爲我得到的錯誤:

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'. 

研究之後,我認爲這個問題是倉庫我cvs2git創建不是光禿的。

那麼如何將更改推送到此遠程存儲庫?我對git的(有限的)瞭解是每個克隆都相互平等,對於位於遠程存儲庫的副本沒有特別的「特殊」。那麼我可以刪除當前存在的內容,創建一個新的裸存儲庫,並從遠程客戶端推回到遠程存儲庫?

回答

1

So can I delete what is currently there, create a fresh bare repository, and push from my remote client back up to the remote repository?

是的,你可以這樣做 - 事實上,它可能是最簡單的方法。