某文件之前git提交过,之后要排除提交,在.gitignore 不生效,使用以下命令 git rm -r --cached . git add . git commit -m "fixed untracked files"