Mercurial中的克隆和复制之间的区别 [英] Difference between cloning and copying in Mercurial

查看:52
本文介绍了Mercurial中的克隆和复制之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是将.hg目录复制到另一个目录中还是与Mercurial中的克隆相同(尽管我认为这无关紧要,所以使用TortoiseHg),或者Mercurial中的cloning命令在此过程中有什么特殊之处吗?

Is copying the .hg directory to another directory the same as cloning in Mercurial (using TortoiseHg although I think that's irrelevant) or does the cloning command in Mercurial do something special during that process?

推荐答案

几乎相同.克隆做了一些不同的事情,不需要做任何事情,但是其中一些很酷:

It's almost the same. Cloning does a few things different, none of which are required, but some of which are cool:

  • 克隆也获得一个工作目录(使用-U可以避免该问题)
  • 克隆将源回购设置为.hg/hgrc文件中用于推/拉的默认设置
  • 克隆只能获取原始副本的一部分(克隆-r X只能获取修订版X,并且仅适用于所有祖先)
  • 文件系统支持克隆时,克隆会使用硬链接

最后一个很酷.这意味着,如果我有一个200GB的存储库并且执行了clone -U src dest,我将得到一个完全不使用任何磁盘空间的完整克隆!如果跳过-U,我将得到一个占用空间的工作副本,并且当两个克隆开始分散时,新副本开始占用空间,但是基本的clone -U是瞬时的,并且现代文件上没有磁盘空间系统.副本并非如此(它也可以正常工作).

That last one is pretty cool. It means that if I have a 200GB repo and I do a clone -U src dest I get a full clone that uses no diskspace at all! If I skip the -U I get a working copy that takes up space, and as the two clones start to diverge the new one starts taking up space, but a basic clone -U is instantaneous and disk-space-free on modern file systems. That's not true of a copy (which does work just fine too).

这篇关于Mercurial中的克隆和复制之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆