设置.gitignore无效解决办法
gitignore只能作用于没有被版本管理的文件,如果某些文件已经被纳入了版本管理中,则修改 .gitignore 是无效的。解决方法是先把本地缓存删除,然后再提交。
$ git rm -r --cached . $ git add . $ git commit -m"更新.gitignore" $ git push
附:.gitignore
# Compiled class file *.class .idea target/ **/target # Log file *.log # BlueJ files *.ctxt # Mobile Tools for Java (J2ME) .mtj.tmp/ # Package Files # *.jar *.war *.nar *.ear *.zip *.tar.gz *.rar # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid*
浙公网安备 33010602011771号