maventargethgignore

.hgignore file is not ignoring the maven target/site directory


I've created a basic maven/mercurial setup. I've created a .hgignore in the working directory. I have added the following to the .hgignore file (as per the instructions in https://www.mercurial-scm.org/wiki/.hgignore

/target$
/.DS_Store$
.DS_Store$

I had run hg status and everything was ignored (as expected)

I ran mvn site. Now, when I run the hg status command, everything but the site folder is being ignored in the target folder... e.g.

~/dev/blah >hg st  

? target/site/css/maven-base.css
? target/site/css/maven-theme.css
? target/site/css/print.css
...

nb: as stated earlier, the other files in the target folder (.class, .xml, etc...) HAVE been ignored...

The target/site folder has not been added to the repository (as far as I can tell...)

anyone know where I'm going wrong...?

update: z3a inspired me to try ^target/*$ and that appears to have done the trick...


Solution

  • If you want to ignore the target dir, but not the target/site in your .hgignore put something like this:

    syntax: regexp
    ^target/(?!site)