Sean Sean - 4 months ago 11
Git Question

gitignore won't ignore my .settings/ directory (created by eclipse)

git status:

Untracked files:
(use "git add <file>..." to include in what will be committed)
.settings/


I've tried the following variations on my .gitignore file and nothing seems to work:

.settings/

*settings*

*.settings/

.settings/*


I've never had this much trouble with
.gitignore
, it usually just works. I must be doing something real dumb.

NOTE: My
.gitignore
file has more in it than just that one line (all the other lines works correctly).

Answer

My .gitignore file has a leading forward slash before .settings:

/.settings

where you don't have that slash. Try adding the slash