git rm -r --cached .
git add .
git commit -m 'update .gitignore'
参考资料:https://developer.aliyun.com/article/634481