Git在我的目标文件夹(maven)中正常忽略除“surefire-reports”文件夹以外的所有内容。
我的.gitignore文件:
# Java
*.class
.idea/
# Package Files
*.jar
*.war
*.iml
*.ucls
target/
但是target\surefire-reports\中的文件仍然被git跟踪。请查看git status输出:
# On branch connectionPane
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: target/surefire-reports/TEST-navalwar.ConsolePlayerTest.xml
# modified: target/surefire-reports/navalwar.ConsolePlayerTest.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# gitstatus.txt
no changes added to commit (use "git add" and/or "git commit -a")
目录target\中还有其他文件夹和文件,但是git没有跟踪它们!