针对还未加入版本控制的,只是不想每次提交都见到它:
git ->Unversioned Files ->选择那个不想提交的 ,但是每次又都提示你的文件(可多选),一键搞定。
针对已经不小心提交了的,但是现在又不想加入版本控制了的:
比如这样的
解决问题
删除某文件,
git rm --cached xxx
删除某文件夹下面的所有文件
git rm -r --cached release/
VCS–Refresh File Status
刷新状态,提交一下,舒坦了
不想被加入git的文件终于被删除了,舒服了。
如果遇到报错
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/