2012-03-30 114 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?

是的,你可以这样做 - 事实上,它可能是最简单的方法。