git rm -r --cached ./bin
git rm -r --cached removes files from the Git index (the staging area) but leaves them on your filesystem.
git rm -r --cached
Think of it as: “Stop tracking these files, but don’t delete them from disk.”
Breaking it down:
rm → remove
rm
-r → recursively (folders too)
-r
--cached → remove only from the index, not from your working directory
--cached
So after running it, the files still exist locally, but Git treats them as untracked.
Last updated 1 month ago