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'
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章