如何将git仓库中的文件加入到gitignore

如果文件已经提交到了git仓库中,想加入到.gitignore, 可以这样做

git rm -r --cached 文件名/文件夹名

git提交即可