2

我有一个目录,Maven里面有我的项目。它看起来像这样:

.hg
.idea
parentProject
project1
   .idea
   docs
   src
   target   
   pom.xml 
project2
   .idea
   docs
   src
   target 
   pom.xml
target
pom.xml
.hgignore

我想忽略我所有项目中的.ideaandtarget目录。我已将.ideaandtarget目录包含在其中,但它只会忽略 which文件所在.hgignore的那些目录。.hgignore这意味着仅在根目录中.idea并被target忽略。

如果我.hgignore在所有子项目中添加文件,这不会改变任何文件仍然不会被忽略。

我的忽略列表如下所示:

build
dist
target
faces-config.NavData
.idea
.iml

我应该如何指定以从任何地方.hgignore获取.ideatarget忽略?

4

3 回答 3

5

try hgignore with regex

syntax: regexp
^\.idea$
^target$
于 2012-09-12T10:56:41.073 回答
0

**/.idea和之类的东西怎么样**/target?在这里查看可能的模式

于 2012-09-12T10:55:54.817 回答
0

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:

  1. Created a project and compiled a few times (hence target directory exist)
  2. Decided to add source control to the project so you've initialized a Mercurial repository and executed 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

当谈到.idea目录时,我认为除了使用该.hgignore文件之外别无他法,但我很困惑为什么 Intellij IDE 不会自动添加它。(我本人不是 Intellij IDE 用户)。这是真正要问的问题。

于 2013-06-17T23:06:25.723 回答