The solutions offered here and in other places didn't work for me, so I'll add to the discussion for future readers. I admittedly don't fully understand the procedure yet, but have finally solved my (similar) problem and want to share.
I had accidentally cached some doc-directories with several hundred files when working with git in IntelliJ IDEA on Windows 10, and after adding them to .gitignore
(and PROBABLY moving them around a bit) I couldn't get them removed from the Default Changelist.
I first commited the actual changes I had made, then went about solving this - took me far too long.
I tried git rm -r --cached .
but would always get path-spec
ERRORS, with different variations of the path-spec
as well as with the -f
and -r
flags.
git status
would still show the filenames, so I tried using some of those verbatim with git rm -cached
, but no luck.
Stashing and unstashing the changes seemed to work, but they got queued again after a time (I'm a bity hazy on the exact timeframe).
I have finally removed these entries for good using
git reset
I assume this is only a GOOD IDEA when you have no changes staged/cached that you actually want to commit.