Search code examples
intellij-ideajetbrains-idegit-rmngit

Unable to stop tracking JetBrains .idea files


I have added the .idea files to my .gitignore file and that seems to work fine. Since my .idea files were tracked already, though, earlier posts have suggested the following code, to get them out from under version control.

git rm -rf .idea

or

git rm -r --cached .idea

In either case, though, I get the message:

fatal: pathspec '.idea' did not match any files.

When I list my files in this folder, though, .idea is right up top.

What am I doing wrong?


Solution

  • fatal: pathspec '.idea' did not match any files.

    assuming there would be no file with the name .idea on the path

    Since you are trying to remove the entire folder change your command

    git rm -r --cached .idea
    

    to

    git rm -r --cached .idea/