Solve the problem that idea’s. Gitignore doesn’t work sometimes

go to your project directory and execute the following command in turn:

git rm -r --cached .
git add .
git commit -m 'update .gitignore'


Read More: