如何在 Git 中忽略这个 Eclipse 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15948761/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:25:22  来源:igfitidea点击:

How do I ignore this Eclipse file in Git?

eclipsegitignore

提问by Envin

I tried adding it to my global .gitignorebut it is still showing up as an untracked file when I do git status.

我尝试将它添加到我的全局.gitignore 中,但是当我这样做时它仍然显示为未跟踪的文件git status

researchProject/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator (4).launch

I disabled the JavaScript validator because it kept giving my build errors -- the only solution I found was to disable it.

我禁用了 JavaScript 验证器,因为它不断给出我的构建错误——我找到的唯一解决方案是禁用它。

回答by kostja

add the following lines to your .gitignorefile:

将以下行添加到您的.gitignore文件中:

.project
.settings
.classpath
.metadata

and for your case also

对于你的情况也

.externalToolBuilders

and you should be good to go.

你应该很高兴去。

Do not add .projectand .classpathto .gitignoreif you are working on an eclipse-specific project.

不要添加.project,并.classpath.gitignore如果您正在使用的Eclipse的具体项目。