3
Git正確地忽略了我的目標文件夾(maven)中除文件夾「surefire-reports」以外的所有內容。爲什麼git不要忽略maven目標文件夾中surefire-reports 文件夾的內容?
我的.gitignore:
# Java
*.class
.idea/
# Package Files
*.jar
*.war
*.iml
*.ucls
target/
但文件的目標\萬無一失的報告\仍git的跟蹤。看到git狀態輸出:
# 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")
還有其他文件夾和文件在目標\但git不跟蹤它們!
我在這個項目上工作了兩週,今天我寫了第一個單元測試。我確定這些文件是maven測試階段的結果。 – AlexeyGorovoy
我不認爲我理解你的評論。你的意思是你不認爲這些文件應該被檢查?他們被列爲'修改',這意味着有人檢查了他們,他們已經改變了你的工作副本。 – patrickvacek
感謝您的解釋(我仍然不知道如果目標\始終處於gitignore中,這些文件是如何檢查的),但現在問題已按您建議的方式解決。 – AlexeyGorovoy