解决办法:清理下 git 缓存即可
执行以下命令

#删除git缓存
git rm -r --cached .
git add .
git commit -m 'update .gitignore'