0

Help! In the last months, I created several Git repositorys and pushed them to Codeberg (Gitea). Now, I realized that Git deleted ALL my files on my local machine!

The repository folders are still there but they're empty! All subfolders are still there too but also empty. I checked the respective .git folders but they're empty too. When I type git status Git says:

fatal: not a git repository (or any of the parent directories): .git

Why did that happen? I didn't change ANYTHING for months. Did this happen because I logged into another Gitea account to create other repositories? Can Git handle multiple accounts or just one?

Pretending that I haven't pushed my repos to Codeberg: Is there any way to recover my files?

I don't know what to do, please help! Thank you!

edit: So I checked Windows 10's Recycle Bin and voilà: All Git files had been deleted last month but I hadn't noticed anything... Might the problem be that my PC's internal hard drives are nearly full? But all Git repos are stored on an external drive...

cknoll
  • 2,130
  • 4
  • 18
  • 34
Pixelcode
  • 357
  • 3
  • 15
  • Where are you looking for your files? Do you refer to a web interface or a local clone of your repository? – kowsky Jul 21 '20 at 13:04
  • It's about the files on my local machine/a local clone. – Pixelcode Jul 21 '20 at 13:06
  • 2
    If the `.git` subfolders are emtpy, there is no git repository, and thus git cannot help you recover anything. This is not something that "git did", something else has deleted these files. Can't you just clone your repositories from Codeberg? – kowsky Jul 21 '20 at 13:28
  • But I didn't delete them and there's nobody else who could have done that. Also, I don't think there's any program that would do something like that. I can't believe that my drive is damaged so that only my Git repos are deleted and in such a specific way. Of course, I can clone the repos from Codeberg (I've already downloaded them as .zip files) but I want to avoid this problem in the future. – Pixelcode Jul 21 '20 at 13:46
  • 1
    I can't say anything about gitea or Codeberg or all the other commands and programs that may delete files on your disc, but what I *can* say is that it was no mechanism of git that deleted your files. There simply is no way in git to wipe the contents of your .git folder. – kowsky Jul 22 '20 at 05:40

0 Answers0