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 recently took a new job, and one aspects of the job is maintaining the organisation's Umbraco website. The site was not under source control nor was there a testing environment. Changes were made to a production system with no backups.

My first step was to do source control with Mercurial so I can quickly back out of changes that break things. I accomplished this by creating a local folder, copying the web page data into it, and running hg commit.

I want to use the Robocopy /mir option to pick up deletions as well as changes and additions. My problem is that the /mir option deletes every folder it doesn't find in the source, and my .hg folder isn't in the source.

Is there any way to exclude the .hg folder from deletion, other than copying it out of the destination folder before the robocopy executes? I saw several references to the exclude feature of Robocopy, but they seem to only apply to source folders, not detestation folders.

Both the webserver and the local machine are Windows machines, and I don't have administrative rights to either.

share|improve this question
up vote 2 down vote accepted

While I don't use Mercurial I ran into a similar problem with Git. I worked around it by specifying an external directory for my git repository in my commit script. Works just fine.

share|improve this answer
That sounds very promising! I'll look into it! – Andrew Neely Apr 2 '12 at 18:13
After much searching, it seems as though it may not be possible to specify a different folder for .hg (the repository) – Andrew Neely Jul 6 '12 at 12:46

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.