1.先将需要忽略的文件/文件夹加入到根目录
2.登录gitbash命令端进入本地git库目录
3.依次执以下三行命令
git rm -r --cached . git add . git commit -m 'update .gitignore'
4.打完收工