1

My hard drive failed. No backups. (I know. I know.) Managed to clone the drive and recover most lost data. However, files and directories which were prefixed with dot (or blob) are now without their dot. So I have a visible directory called git with files (COMMIT_EDITMSG, config, description, HEAD and index) and directories (branches, hooks, info, logs, objects and refs). The objects directory has directories (eg. 00, 0a, 0b, etc.) and they each have files with SHA1 hash filenames. The git/objects/pack directory is empty. So from what I can tell... the data is there. I'm hoping I just need to rename the directory(ies) and filename(s) and maybe it'll all work again. Or is this wishful thinking?

Perhaps I should have added I'm using a Mac.

1
  • Have you tried prepending a dot to the folders? (After you make a copy first)
    – spuder
    Aug 24, 2013 at 4:37

1 Answer 1

1

Rename the git directory to .git. Run git fsck to check whether any files were corrupted; if it passes, update the working tree with git checkout -f.

1
  • Worked perfectly. All revisions, commits, comments etc appear in my xcode project as if it was never corrupted.
    – Mike
    Aug 24, 2013 at 17:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .