Issue
Very annoying, gave me around 200 untracked files, every time I delete them they pop back up again. Tried to use lightweight
mode and surprisingly it did not work. They files do not have a pattern but it seems like only adding them to .gitignore
worked. But I thought there should be a better option.
Not sure if the Java Extension Pack did that or not, but after uninstalling it the problems are still there so I reinstalled them.
I really just wish to get rid of them, don't know if it's also causing some build problems. Been stuck on this for more than a week.
Some posts I have looked at:
https://github.com/redhat-developer/vscode-java/issues/618
https://stackoverflow.com/questions/53509715/what-project-files-does-visual-studio-code-create-via-its-java-extensions\
VS Code Java Debugger Making a Lot of Untracked Files (My previous post but it died)
Thank you!
Solution
About removing untracked files from the working tree, the short answer as per the Git Documents is git clean.
Cleans the working tree by recursively removing files that are not under version control, starting from the current directory.
[UPDATE]
The command git clean -d -f
has it recurse into untracked directories, so you can also delete all untracked files in subfolders.
There's a configuration that can hide these untracked files in User Settings.json:
"java.configuration.checkProjectSettingsExclusions": true
Answered By - Molly Wang-MSFT Answer Checked By - Marilyn (WPSolving Volunteer)