Reputation: 749
I am using a SATA SSD that I always keep on myself and that I'm storing all my projects on.
Recently though, I started losing data when plugging the SSD into a PC after being plugged into another one (most files ended up being nothing but this character, repeated x times: �)
Both devices run Windows 10.
If this happens, I can plug the SSD out and back in, resulting in the data being restored.
But after I do this, all files in my workspace suddenly end up being unstaged and if I try to open the git log with the VS Code extension Git History (v0.4.6), this is git's output:
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git rev-parse --show-toplevel
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
This basically always means I have to delete the .git
folder and having to git init
again, resulting in all my progress being lost.
I've also tried doing the things in the answers of this Stackoverflow question but that also just clears the history and I lose all progress.
This is really, really frustrating and I don't know what the exact issue is.
The git login information is the exact same on both PCs.
SSD hot-swapping is enabled on both PCs and I always make sure to use the Windows thing to remove the external drive securely or wait until the PC is shut down completely but still this keeps happening.
Upvotes: 2
Views: 69