Folder added it .gitignore still showing up in the Git changes



Ok so I recently upgraded to Angular 13 and now I have this folder name ".angular".

I have added its entry in .gitignore file as .angular/cache since it don’t want to track it, but files inside it are always shown in git changes as Untracked files.

Almost every answer on StackOverflow tells to run the following commands.

git rm -r --cached .
git add .
git commit -m ".gitignore is now working"

All this does is staging the untracked file and then making a commit out of them. My .angular folder is still being tracked. It is still not greyed out like node_modules which means git isn’t ignoring it.

Should I be doing anything different?


If there are other folders/files in .angular and you only ignore the folder cache with .angular/cache in the .gitignore-file, the .angular folder would be continue tracked.

So you must ignore the whole .angular folder with .angular/ in .gitignore.

After this, the .angular folder would be greyed out like the node_module folder as you mentioned.

Answered By – SwissCodeMen

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More