I have .idea in gitignore, but it is still in local changes
In Git, it is only possible to ignore unversioned files. If a file is already tracked in git, it is not possible to ignore it. You need to stop tracking it in git, which can be done using git rm --cached command. After committing this change, files should go ignored, since there is a rule to ignore them already.