The solution mentioned in ".gitignore file not ignoring" is a bit extreme,but should work:
# rm all files
git rm -r --cached .
# add all files as per new .gitignore
git add .
# Now,commit for new .gitignore to apply
git commit -m ".gitignore is Now working"
参考资料:nore-file">https://stackoverflow.com/que...