将从cvs2git创建的存储库转换为裸存储库

时间:2012-03-30 23:13:03

标签: git

几个月前我设法运行cvs2git并为某些代码创建了一个git存储库。我从cvs导入了一个我想用作远程存储库的专用服务器。

今天,我第一次尝试从远程存储库进行克隆,并且能够成功克隆。但是,当我尝试将更改推回到远程存储库时,它似乎并不是因为我收到错误:

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 个答案:

答案 0 :(得分:1)

  

那么我可以删除当前的内容,创建一个新的裸存储库,并从远程客户端推送回远程存储库吗?

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