Have you ever found a problem when you ignoring files or directory on git, but it is still saying it’s modified? Well, i am. A lot.

It is usually because the file or directory has been modified before and has been indexed on the git tree.

What we need to do is removing it from the index. But,

Using git rm won’t only remove it from the index but delete it too.

We need to use spesific command, like

$ git rm --cached filepath

to remove directory (-r: recursive, -f: force)

$ git rm -rf --cached directory

Removing the file cached won’t remove the file, and leave it unstage. So whatever changed you’ve made it ain’t matter.