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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 官网 中文版本 好的网站 Content-type: text/htmlBASH Section: User ...
    不排版阅读 4,500评论 0 5
  • 1.编写POM Maven项目的核心文件是pom.xml,POM(Project Objcet Model)项目对...
    zlcook阅读 5,950评论 7 26
  • 第1章 Maven 介绍 什么是 Maven 什么是 Maven Maven 的正确发音是[ˈmevən],而不是...
    强某某阅读 2,427评论 0 25
  • 在使用Git的过程中,我们喜欢有的文件比如日志,临时文件,编译的中间文件等不要提交到代码仓库,这时就要设置相应的忽...
    yichen_china阅读 1,010评论 0 3
  • 个人学习批处理的初衷来源于实际工作;在某个迭代版本有个BS(安卓手游模拟器)大需求,从而在测试过程中就重复涉及到...
    Luckykailiu阅读 4,799评论 0 11