'Every file added to .gitignore was deleted by Git during a Pull
I recently wanted to start tracking some project files for a certificate course I'm taking, so I got the Git Desktop app and linked my main project folder to my Github repo, where I intended to only track specific folders.
So thinking this was the right way to go, I added basically everything that I didn't want to track to the .gitignore file.
All these Jupyter Notebooks, tens of thousands of data images, etc.
And after one night, and one pull to get the readme from the online repo into my local files, Git deleted every single file that was named on the .gitignore file.
Every folder is empty, except for the tracked project folders.
Is there a way to recover the files, and prevent this from occurring in the future?
Solution 1:[1]
That would be the same as git clean -X, and I don't see why GitHub Desktop would ever execute that.
Check the logs of GitHub Desktop to confirm if those deletions are coming from this application.
But regarding non-tracked deleted elements, there is not much beside file recovery utility, as detailed in "Can I restore deleted files (undo a git clean -fdx)?", or on your IDE.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | VonC |
