使用.gitignore文件删除掉已经提交的文件
顺序依次执行如下命令:
First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
This removes any changed files from the index(staging area), then just run:
git add .
Commit it:
git commit -m ".gitignore is now working"
最后提交到远程仓库,会发现.gitignore文件起作用了。