git忽略并删除已经提交到git上的文件
删除本地缓存中的文件
git rm -r --cached 文件名
复制代码
将删除的文件添加到本地暂存区
git add .
复制代码
将本地变更信息提交到本地仓库
git commit -am '变更信息'
复制代码
推送到远程仓库
git push orgin 分支名
复制代码
git rm的帮助文档
$ git rm -h
复制代码
usage: git rm [] [--] ...
-n, --dry-run dry run
-q, --quiet do not list removed files
--cached only remove from the index
-f, --force override the up-to-date check
-r allow recursive removal
--ignore-unmatch exit with a zero status even if nothing matched
复制代码