.gitignore无效的情况的原因和处理方法

git路径下想要将一些文件移除git管理

则需要

git rm --cached path/fileignore

git add .

git commit -m "git rm --cached path/fileignore"

如果是路径则

git rm --cached -r path/dirignore

这样push以后该文件path/fileignore 将不会被再被git track 了,移除git仓库了.

原文地址:https://www.cnblogs.com/wangziqiang/p/5795793.html