Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Have you tried prepending a dot to the folders? (After you make a copy first) – spuder Aug 24 '13 at 4:37
up vote 0 down vote accepted

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.

share|improve this answer
Worked perfectly. All revisions, commits, comments etc appear in my xcode project as if it was never corrupted. – Mike Aug 24 '13 at 17:44

You must log in to answer this question.

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