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?
clone - create something new based on something that exists. copying - copy from something that exists to something else (that also already exists).
Cloning a repository gives you a copy of that repository and configures the original repository as a remote. Copying a repository just gives you a copy of that repository. (Though you can of course just add the remote definition afterwards via git remote add .)
Clone a remote Mercurial repositoryFrom the main menu, select Hg | Get from Version Control. The Get from Version Control dialog opens. In the dialog that opens, select Mercurial from the Version control list and specify the URL of the remote repository you want to clone. Click Clone.
Clone just lets you select how many copies you want. Eg if you want to duplicate a field (or multiple fields) several times, then just select the field(s) and use clone. It will prompt for how many copies you want, then create that many in one go. Duplicate just does one duplicate of all selected fields at a time.
It's almost the same. Cloning does a few things different, none of which are required, but some of which are cool:
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With