Reputation: 23413
I have a directory with my Maven
projects in it. It looks like this:
.hg
.idea
parentProject
project1
.idea
docs
src
target
pom.xml
project2
.idea
docs
src
target
pom.xml
target
pom.xml
.hgignore
I want to ignore the .idea
and target
directories in all my project. I have included the .idea
and target
directories into .hgignore
but it only ignores those directories in the which .hgignore
file is. This means that only in root directory .idea
and target
is ignored.
If I add .hgignore
file in all sub projects this does not changes anything files are still not ignored.
My ignore list looks like this:
build
dist
target
faces-config.NavData
.idea
.iml
How should I specify in the .hgignore
to get the .idea
and target
ignored from everywhere?
Upvotes: 2
Views: 2754
Reputation: 19275
You should not need to explicitly ignore target
directory.
This problem will come if you have added it by mistake to Mercurial. Let's say you have done the following:
target
directory
exist) hg add
command
(either implicitly or explicitly from the IDE). Bam! You have now
told Mercurial that target
is a directory that should be included.Trust me. I've been there !
To fix: Do the following from the command line:
hg forget target
When it comes to .idea
directory I would think there's no other way than to use the .hgignore
file but I'm puzzled why Intellij IDE doesn't add this automatically. (not a Intellij IDE user myself). That is the real question to ask.
Upvotes: 0
Reputation: 10606
How about something like **/.idea
and **/target
? Check out the possible patterns here.
Upvotes: 0