Search code examples
gitgithubdelete-filecorrupt

Deleting corrupt git files


I have been using the desktop version of Git Hub for about a month, and I have run into some trouble with deleting a directory. I just moved all of my individual projects into one repository for better organization especially since a lot of the projects were small and basic for school. I am trying to delete the previous files off of my computer, but I was getting an error that the files were not empty despite appearing so. I then tried doing so in cmd prompt and got more information that it was git files that were corrupted. I then went into the git bash and still couldn't find the files. Does anyone know how to delete these?

I should also note that I was using an external hard drive and switching it between my laptop and pc so I wouldn't have to continue to re-download and update the projects over and over. I guess this may have been what caused the problem in the first place? How should I go about using my HD so that I don't ruin files. I think I was encountering problems because my GitHub desktop applications were not synced between the two computers.

Also I am using VS Code. Not sure if the version control within that is messing anything up.


Solution

  • Whenever "previous files" cannot be deleted, close first all program (or even reboot) in order to ensure no process keep an handle to said files, preventing their deletion.

    Then open the git repository folder with VSCode.