Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am planning to use Mercurial in the near future on some projects. These projects will normally reside in a directory on my Windows machine, but I will be sharing these directories using VirtualBox so I can work on them directly from within Linux.

I understand that Mercurial will sometimes create hard links when cloning repositories. I'm not sure how a VirtualBox shared directory handles these hard links (or if it even can), so I'd rather just tell Mercurial to never attempt to make hard links and always make a copy.

My question: how do I globally disable Mercurial from hard linking?

(Although if someone has gotten Mercurial and VirtualBox shared folders to work nicely with hard linking, I'd like to hear about it!)

share|improve this question
I do not think that you should have problems. Hardlinks are working only if the filesystem where you want to create the hardlink is supporting them (bot the driver and the fs structure). For example if you have a FAT filesystem you will not be able to create hardlinks. The vboxsf VFS driver does not support links (neither symbolic or hard). This means that it will fail to create hardlinks, but you will be able to see them properly if they already exist. See: – Mircea Vutcovici Mar 29 '10 at 20:46
up vote 2 down vote accepted

As Mircea said, you shouldn't have to worry about this. But still, you can force a clone to be without hardlinks by doing

hg clone --pull foo bar

This basically does the same as

hg init bar
cd bar
hg pull ../foo

and won't create hardlinks between the clones.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.