0

I was using GitHub for more than a year, but right now I cannot handle ignoring files.

I’m trying to ignore files that are generated by my IDE, and also ignore .pyc files. But they keep appearing in my changes. I already tried to put:

experience/.idea
experience/.idea/*

Take a look at this screenshot:

screenshot

Zombo
  • 1
  • 62
  • 391
  • 407
yeralin
  • 1,357
  • 13
  • 24
  • Possible duplicate of [Ignore files that have already been committed to a Git repository](http://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository) – coagmano Oct 19 '15 at 00:45

2 Answers2

1

There are two parts to this:

  1. Be sure that you're using the right directory matching scheme, since you want to just block the directory. For that, you want to change experience/.idea/** to just experience/.idea/.

  2. Be sure that Git isn't tracking any of those files anymore by removing them from the stage via git rm --cached <paths-to-ignore>.

Makoto
  • 104,088
  • 27
  • 192
  • 230
1

If a file is already under version control, adding it to the .gitignore won't remove it from the index.

You need to remove it yourself using git rm --cached <files>

coagmano
  • 5,542
  • 1
  • 28
  • 41