git 错误提交,删除后,增加 ignore commit 仍会出现

JAVA MAVEN 项目可用 ignore
# Created by .ignore support plugin (hsz.mobi)
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

### Java template
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
*.iml

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

!/logs/
/.idea/

在项目目录下执行如下命令
git rm -r --cached .    //清除缓存区,注意最后有个"."

git add .                    //重新纳入版本管理,注意最后有个"."

git commit -m 'update .gitignore'    //提交新的忽略文件。
最后 push

你可能感兴趣的:(git 错误提交,删除后,增加 ignore commit 仍会出现)