如何从Mercurial克隆中删除工作副本? [英] How can I remove the working copy from a Mercurial clone?
问题描述
克隆带有Mercurial的存储库时,可以传递-U/-noupdate标志来创建没有工作副本的克隆.如果我忘记在克隆时通过此标志,可以删除工作副本吗?如果可以,怎么办?
When cloning a repository with mercurial you can pass the -U/--noupdate flag to create a clone with no working copy. Can I remove the working copy if I forget to pass this flag at clone time? And if so, how?
从概念上讲,它与此git问题类似,但出于商业目的.
This is conceptually similar to this git question, but for mercurial.
推荐答案
Mercurial Wiki上的文档对裸仓库有以下看法:
Documentation at Mercurial wiki says following about bare repositories:
"尽管这是一个小问题,但Mercurial显然可以处理 裸仓库也就是说,没有工作副本的存储库.在Git中 您需要一个配置选项,而在Hg中,您只需要 检查空修订,例如:"
"Although this is a minor issue, Mercurial can obviously handle a bare repository; that is, a repository without a working copy. In Git you need a configuration option for that, whereas in Hg you only need to check out the null revision, like this:"
hg update null
空修订版与刚完成hg init
时的空状态相似.它是修订版0的父级(并且是所有非合并修订版的第二个父级),通过更新回它,您将再次获得一个空的工作副本.
The null revision is similar to the empty state you have when you have just done hg init
. It is the parent of revision 0 (and the second parent of all non-merge revisions) and by updating back to it you again get an empty working copy.
该链接可能具有讽刺意味:
The link may look ironic:
这篇关于如何从Mercurial克隆中删除工作副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!