Git 忽略文件 .gitignore 不生效解决办法

git rm -r --cached .
git add .
git commit -m 'update .gitignore'
git push -u origin master