gitignore 无法过滤掉target下的文件 解决办法 在目标文件夹下右键 git bash ,即可调出控制台输入命令行: git rm -r --cached . git add . git commit -m 'update .gitignore'