Problem
I’d already added .idea/misc.xml and .idea/workspace.xml to my .gitignore, but every time I opened my project, Git still showed these files as modified.
Reason and Solution
The catch is that .gitignore only applies to untracked files — Git never ignores changes to files it’s already tracking. If a file keeps showing up as modified, that means it’s still under version control (and .idea/workspace.xml usually shouldn’t be), so every change to it gets picked up no matter what your .gitignore says.
The fix is to remove the file from Git’s index while keeping your local copy untouched:
git rm --cached .idea/workspace.xml
Commit that change, and from then on the file will actually be ignored — unless you force-add it back or tweak your .gitignore rules again.