0

I was pushing to a git repository, when it was taking too long, and I killed it using ^C.

Personas-MacBook-Pro:ReCDroid personanongrata$ git push
Enumerating objects: 12911, done.
Counting objects: 100% (12911/12911), done.
Delta compression using up to 8 threads
Compressing objects: 100% (12413/12413), done.
^Citing objects:  16% (2192/12910), 1.34 GiB | 702.00 KiB/s      
Personas-MacBook-Pro:ReCDroid personanongrata$ git status

According to this, it should be safe to kill a push process, but all the data has been deleted on my computer. How can I recover it? Thanks!

Inigo
  • 12,186
  • 5
  • 41
  • 70
Mr. Ng
  • 41
  • 6
  • 2
    What does git status say now? What does the directory contain? Are you sure this is gits fault? Perhaps an external process deleted the files in question. – PiRocks May 14 '20 at 22:09
  • 2
    you show the "git status" command but not what it returned. Is this like a cliffhanger for next season? – JoelFan May 14 '20 at 22:23
  • I tried reverting the commit, that did nothing. I'm a dumbass, accidentally closed that terminal session so lost all output. Now all git says On branch master Your branch is up to date with 'origin/master'.Untracked files: (use "git add ..." to include in what will be committed) .DS_Store Artifact-Evaluation/ Comparison/ nothing added to commit but untracked files present (use "git add" to track) But those folders/files are only small fraction of what was there originally – Mr. Ng May 14 '20 at 22:29
  • Say `git ls-tree -r --name-only HEAD`. Do you see all your files now? – matt May 15 '20 at 04:00
  • @matt if it hangs like both his `git push` and `git status` apparently did, that's Evidence #3 for my answer. – Inigo May 15 '20 at 04:03
  • #MrNg, it would be proper and polite to let people know how you resolved this, especially because people generously gave you their time. You do this by adding a comment, accepting an answer, or closing the question if you have given up. I hope my diagnosis was wrong (for your sake), but I I would like to know, either way. – Inigo May 19 '20 at 19:21

1 Answers1

1

looks like file system or disk issues.

Evidence #1: "it was taking too long"

Why was it taking so long? Was it in fact hung? Corrupt/failing hard drive?

Evidence #2: git status never returns. No error messages.

I'm assuming the last line of your console output is git status with no output because it hung too.

This points to file-system level corruption or disk/SSD failure.

Expert Witnesses

It is highly unlikely that git could have done this.

Verdict

Backup your drive and the run checks on the partition and drive. Try the solutions at the above links.

Inigo
  • 12,186
  • 5
  • 41
  • 70