git --Hg (Mercurial) 的裸克隆类似物

git --bare clone analogue for Hg (Mercurial)

我只想签出存储库的历史记录。

是否有像git --bare clone <repo_url>选项一样克隆历史的选项?

我不使用 Mercurial,但根据帮助我会说离你最近的是

-U --noupdate the clone will include an empty working directory (only a repository)

根据@Ry4anBrase 的回答更新:

对于现有存储库 hg update null 删除所有本地文件。这将检出 null 修订版,即修订版 0 之前的修订版,并且不包含任何文件。如果您签出该修订版,您的本地文件就会消失,结果您得到了一个裸克隆。

@vampire 有你对新克隆的答案。对于现有的 hg update null 就可以了。这检查了 null 修订版,它是修订版 0 之前的修订版,并且不包含任何文件。如果您签出该修订版,您的本地文件就会消失,您将得到一个裸克隆。