git忽略target目录

1、目录结构

git忽略target目录_第1张图片

2、.gitignore文件

*.class
.DS_Store
application.pid

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

# Package Files #
*.jar
*.war
*.ear

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

# Eclipse
.classpath
.project
target
.settings

# Idea
.idea
*.iml

# git
*.orig

3、无效解决方案

#先把本地缓存删除(改变成未track状态)
git rm -r --cached .	
然后再提交
git add .	
git commit -m 'update .gitignore'

你可能感兴趣的:(git,github)