0

I have a hidden folder /.idea from the IDE that I want to ignore. I have followed the patter of https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore but it is not being ignored.

// .gitignore

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules
package-lock.json
**/node_modules

# testing
/coverage

# production
/build

# Things that I have tried
.idea/
/.idea/
.idea/**

What would be the way to ignore it?

feralamillo
  • 819
  • 8
  • 10
  • 1
    Did you already committed it ? – Hurobaki Jan 15 '20 at 10:38
  • 1
    Does this answer your question? [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – phd Jan 15 '20 at 11:55

1 Answers1

4

If you already commited your .idea folder you need to remove it from git index

git rm --cached -r .idea

The correct way to ignore a folder inside your .gitignore file is the following

.idea/
doitlikejustin
  • 6,293
  • 2
  • 40
  • 68
Hurobaki
  • 3,728
  • 6
  • 24
  • 41