gitignore cache confusion

Answered

I have some files in my ionic/angular project that were covered by my .gitignore file but somehow got into git.. They are .js and .js.map files that the project explorer shows under the .ts file (correctly).  I have a project-level .gitignore /*.js and /js.map statements, but as I said a few .js and .js.map files are in git. Some searching indicates I should remove them from git, clean the cache, and then commit again.  Is that correct, can I do this in the ide?  Thanks

3 comments

To stop tracking a file in git, you need to remove it with the git rm --cached command.

At the moment it is not possible to commit such change via IDEA, so please do this on the command line. Make sure to commit from the command line as well.

See https://youtrack.jetbrains.com/issue/IDEA-138847 and actually https://youtrack.jetbrains.com/issue/IDEA-107359

0

Thanks Dmitriy. In may case, the wildcard expression I was using was incorrect. I had entered /src/*.js, and needed /scr/**/*.js

So it wasnt a plugin or cache issue after all.

0

Thanks for the update, glad you found the root cause.

0

Please sign in to leave a comment.