Git .gitignore 如何忽略 eclipse 的 maven 带 modules 的 target 目录

string2020 · 2015年08月11日 · 最后由 string2020 回复于 2015年08月11日 · 7785 次阅读

在 eclipse 里面新建了 maven 项目,带 modules 的,现在有 3 个 module,以后还会增加

现在想用.gitignore 忽略部分文件

git 只需要跟踪

pom.xml,src 以及所有 module 下的 pom.xml,src

其他所有的都要忽略掉

请问,这个.gitignore 怎么写 比如说,这个例子 这个是根目录下的结构 其中, camel-example-* 是 module 这是其中一个 module 的结构

/* !.gitignore !src/ !**/src/

!pom.xml !**/pom.xml

这样写,没有效果 求正确的写法

需要 登录 后方可回复, 如果你还没有账号请 注册新账号