简体   繁体   English

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

[英]converting a repository created from cvs2git into a bare repository

I managed to run cvs2git several months ago and created a git repository for some code. 几个月前,我设法运行cvs2git并为某些代码创建了一个git存储库。 I imported from cvs into a dedicated server that I want to use as a remote repository. 我从cvs导入了一个专用服务器,该服务器要用作远程存储库。

Today, for the first time, I tried cloning from the remote repository, and was able to successfully clone. 今天,我第一次尝试从远程存储库克隆,并且能够成功克隆。 However, when I tried to push changes back up to the remote repository, it seems like it's not bare because I get the error: 但是,当我尝试将更改推回远程存储库时,这似乎并不光明,因为出现错误:

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

After researching it, I think the problem is that the repository I created with cvs2git is not bare. 经过研究后,我认为问题在于我用cvs2git创建的存储库并不裸露。

So how can I push changes to this remote repository? 那么如何将更改推送到此远程存储库? My (limited) understanding of git is that every clone is equal to each other, and there's nothing particularly "special" about the copy that is located on the remote repository. 我对git的(有限的)理解是每个克隆都彼此相等,并且远程存储库上的副本没有特别的“特殊”之处。 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? 那么,我可以删除当前存在的内容,创建一个全新的裸存储库,然后从远程客户端推送回远程存储库吗?

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? 那么,我可以删除当前存在的内容,创建一个全新的裸存储库,然后从远程客户端推送回远程存储库吗?

Yes, you can do that - in fact, it'd probably be the simplest way. 是的,您可以这样做-实际上,这可能是最简单的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM