got remove file from repo not locally code example Example: git remove files from repo but not locally git rm --cached `git ls-files -i -X .gitignore`