Remove a directory from a remote Git repo without deleting it locally.
Stop tracking an entire directory. This is useful after having added the directory to .gitignore.
git rm -r --cached <your directory>
-
rm
- Remove files from the working tree and from the index.
-
-r
- Allow recursive removal when a leading directory name is given.
-
--cached
- Remove files from the index only (not the working tree).