GIT 忽略已经track的文件

979 阅读1分钟

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

原文 blog.csdn.net/yaomingyang…