Cause
The nature of .gitignore is that only newly added files are ignored.[ gitignore Intellij git ignore .idea gitignore not working ]In the situation that a directory has been added to your repository, e.g. the mentioned .idea, then changes to these directories or file files are simply tracked by Git. To resolve the problem, you must remove this path from the git cache. The same problem applies to every other case, i.e. any directory or file.
.gitignore: Solution
As I mentioned above to solve the issue we must remove this path from cache. Please use the command below to do this.
git rm --cached -r .idea
If you enjoyed this post please add the comment below and share this post on your Facebook, Twitter, LinkedIn or another social media webpage.
Thanks in advanced!