21

I can't exclude files from .idea folder from tracking by git. It is on the same level as .gitignore file and my .gitignore contains:

.idea

and even:

idea

Any advice guys?

Eugene
  • 59,186
  • 91
  • 226
  • 333
  • 1
    Is it already checked in? Read the comments here: http://stackoverflow.com/questions/8021441/gitignore-hidden-dot-directories – Wes Aug 22 '12 at 16:17
  • that's hilarious. I googled this and it's the same folder I'm trying to ignore – Kellen Stuart Dec 13 '19 at 03:34

1 Answers1

27

Append a slash to exclude directories.

.idea/
Blake Taylor
  • 9,217
  • 5
  • 38
  • 41
  • 1
    still see files in this folder with 'git status' – Eugene Aug 22 '12 at 16:15
  • 25
    If the files have already been committed or added to the index, you'll need to also remove them from git `git rm --cached .idea/**/*`. Commit that and you should be all set. – Blake Taylor Aug 22 '12 at 16:32
  • 15
    Maybe due to version change, seems that the command should be `git rm -r --cached ` – Daniel Jul 10 '14 at 05:31