0

Recently my macbook pro hard drive started to give IO errors and I started to loose the abiblity to accesss data files. I had my code on it, luckily after several copy attempts it appears to have copied project to my backup drive.

I want to check all the project data recovered (git repo) is correct and not corrupt. Can you suggest what should I do to check its integrity ?

Edit I ran the command

git fsck 

But this has given output of atleast 150 lines all containing similar to the one shown below nothing else

dangling blob 0ea049081a915adecebfced424ae9bd10ff70075

Does it mean the data has been corrupted ?

Thanks,

Ahmed
  • 14,503
  • 22
  • 92
  • 150

1 Answers1

0

Run git-fsck. Also see this answer.

Community
  • 1
  • 1
sschuberth
  • 28,386
  • 6
  • 101
  • 146
  • Dangling objects do not necessarily mean there's corruption. It could also be commits of a deliberately deleted branch that were not yet garbage collected. Try `git fsck --no-dangling` to see if you get any other errors. – sschuberth Apr 13 '15 at 20:27
  • --no-dangling does not give any information just says checking obj directories 100% done. – Ahmed Apr 13 '15 at 21:03
  • Reading through [How to fix a broken repository?](https://git.wiki.kernel.org/index.php/GitFaq#fix-broken-repo) again which says `Ok, I removed the "dangling commit" messages, because they are just messages about the fact that you probably have rebased etc, so they're not at all interesting.` confirms that ignoring dangling commits is fine. They recommend to use `--full`, however. If you don't see any `broken link` or `missing blob` messages with this you should be fine. – sschuberth Apr 14 '15 at 07:09