How to ignore IDE settings on Git?

I have below git information and I would like to ignore the settings of my IDE (Eclipse).

modified:   myproject/.classpath
modified:   myproject/.project
modified:   myproject/.settings/com.google.gdt.eclipse.core.prefs
modified:   myproject/.settings/org.eclipse.core.resources.prefs
modified:   myproject/.settings/org.eclipse.jdt.core.prefs
modified:   myproject/.settings/org.eclipse.wst.common.component
modified:   myproject/.settings/org.eclipse.wst.common.project.facet.core.xml
modified:   myproject/.settings/org.eclipse.wst.validation.prefs

I tried the instructions below in my file .gitignore, but it does not work for these settings:

.project
.classpath
.settings
*.project
*.classpath
*.settings
/.project
/.classpath
/.settings
.project/
.classpath/
.settings/
*.project/
*.classpath/
*.settings/

I am using Mac OS X and also added a global gitignore file with these settings git config --global core.excludesfile '~/.gitignore', but I still get Git update messages when checking with git status. What am I wrong?

+4
source share
2 answers

If these items have already been completed, you must first delete them:

git rm --cached .project
git rm --cached .classpath
git rm --cached -r .settings

The option --cachedallows them to remain in the working tree, writing for deletion.
After deletion, they will be ignored.

.

.gitignore myproject/ :

.project
.classpath
.settings/

/ .setting: .

+13

.gitignore - java:

*.class
*.swp
*.cache
*~

bin/**/*
target/**/*
build/**/*
gen/**/*

# tmp source folder
tmp/**/*


# js plugin
WebContent/js_plugin/lib/**/*

git 1.8.2, abc , :

**/abc/**/*

, git, .

, , IDE, .classpath git, - , , jdk/tomcat/... . , jar maven, .
, eclipse, , , , , , . 2 , git checkout - xxx , .

+2

Source: https://habr.com/ru/post/1547227/


All Articles