Super User is a question and answer site for computer enthusiasts and power users. 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'd like to hg add excluding files that begin with ._, or even better exclude all hidden files.

It's not working, it's just completely ignoring my -X option.

I tried the following:

hg add -n -X '._*'
hg add -n -X '*._*'

and just to be sure also:

hg add -n -X '*.*'

nothing. It's just as if I didn't -X at all.

I've tried both with hg 1.4.3 and hg 1.0.1

share|improve this question
up vote 1 down vote accepted

(This works on Windows and Mercurial 1.5.3; things may be different for Unix if that's what you're using).

You have the file spec. in single quotes; it should be double quotes:

hg add -X "._*"

Another way would be to add an entry to your .hgignore file, for example:

 syntax: glob
share|improve this answer
I'll have a look at .hgignore because it seems it should do it, thanks :) (btw: I'm using OSX) – o0'. May 29 '10 at 16:07
it worked, thanks :) – o0'. May 31 '10 at 20:06

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.