yeralin
yeralin

Reputation: 1407

GitHub ignorefiles

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

Upvotes: 0

Views: 48

Answers (2)

coagmano
coagmano

Reputation: 5671

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>

Upvotes: 1

Makoto
Makoto

Reputation: 106389

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>.

Upvotes: 1

Related Questions