情形
已经对某个文件(夹)进行提交,想要删除对这个文件(夹)的跟踪。例如误提交工具自动生成的配置文件等
命令
git rm --cached 文件路径 //递归删除添加 -r
配合.gitignore
git rm -cached说明
When –cached is given, the staged content has to match either the tip of the branch or the file on disk, allowing the file to be removed from just the index.
效果
删除对指定文件(夹)的跟踪