I am using TFS Git and I was able to delete the unwanted file on the server through the TFS project site. Then I synchronized the local project with the server.
When you open a project for VS synchronization, you may complain that you cannot synchronize until you commit the changes to the junk file. This is exactly what I did not want to do, I wanted the file to disappear.
However, on the change screen, I right-clicked the file and said βdiscard the changesβ, and this made it leave.
After canceling the changes, I was able to synchronize, and the server deleted the unnecessary file from my local repository.
source share