简体   繁体   中英

Visual Studio Code Git won't discard files

I have about 5000 files that I am unable to discard and VSCode keeps warning me that there are too many files. I'm not sure when I started tracking these files, but if I click on discard and then confirm the discard, nothing happens. Any ideas on how I can solve this?

VSCode recently renamed the "Clean" option onto "Discard" .
But it is about unstaging current changes, not deleting files.

If you have too many files (that should not be part of the repo, for example because they are generated), simply delete them, then record your deletion (add and commit).
Then you will be able to push.

Additionally, consider adding them (or their parent folder) to a .gitignore file.

this is from a while ago but for anyone else having this problem. The way I solved it was because I had clicked my home directory when using source control.

Try closing and reopening vs code and once the "open a folder" option comes up pick the specific project folder and the 5000 files should be reduced to the files you want

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM