git rm -r --cached . git add . git commit -m 'update .gitignore'
如果遇到报错
error: the following file has staged content different from both the file and the HEAD: .idea/caches/build_file_checksums.ser (use -f to force removal)
那么再加个-f就完事了:
举例:强制删除.idea文件夹下面的所有文件
git rm -r -f --cached .idea/
标签:git,--,idea,过滤,file,rm,gitignore From: https://www.cnblogs.com/smile008/p/16891085.html