4

I just fired up gitk as usual but this time I received a fatal error message:

fatal: loose object 58008283f6ad152ac44a1b6da961795ababe5b93 (stored in .git/objects/58/008283f6ad152ac44a1b6da961795ababe5b93) is corrupt
fatal: loose object 58008283f6ad152ac44a1b6da961795ababe5b93 (stored in .git/objects/58/008283f6ad152ac44a1b6da961795ababe5b93) is corrupt
    while executing
"close $gdtf"
    (procedure "gettreediffline" line 36)
    invoked from within
"gettreediffline file1071e148 58008283f6ad152ac44a1b6da961795ababe5b93"
    ("eval" body line 1)
    invoked from within
"eval $script"
    (procedure "dorunq" line 11)
    invoked from within
"dorunq"
    ("after" script)

I clicked OK on the error message box, exited gitk, then started gitk again -- this time it came up without any errors (just as usual).

What does this error mean and why did I receive it?

Should I start worrying about the integrity of my repository? (at this point still local, in a .git subdirectory)

UPDATE: I just ran git fsck as suggested below and I got:

git fsck
dangling blob 6302f0a93a8d793b473e1a1976f221827b595ed7
dangling blob 5246a9d7408b1d5d01e9c471a67c1f0866f0d626
dangling blob ec08d18657f37e5bbdbebc7dc25615037b532463
dangling blob 8b69b97bdc45f3c86405f67a5f396d122408ad64
dangling blob aa39e78673ec3f2cb575798be1d2b4555c637475
  1. What does "dangling blob" mean?
  2. How could this have happened?
  3. Is there a way to fix this?
WinWin
  • 7,493
  • 10
  • 44
  • 53
  • sound like a good opportunity to run `git fsck` [link](http://book.git-scm.com/4_maintaining_git.html) – Fredrik Pihl Jul 26 '11 at 17:25
  • @Fredrik Thanks for this tip. I didn't know about `git fsck` until now. I just ran it and the results seem to point to a problem (or more). See update in my OP. What do I do now? – WinWin Jul 26 '11 at 17:33
  • 1
    @WinWin the dangling blobs are not necessarily an issue. They just state that you have blobs without anything pointing to them. [This may help](http://stackoverflow.com/questions/4254389/git-corrupt-loose-object) – Andy Jul 26 '11 at 17:54
  • @Andy I just did `git show` on one of the objects and received 56,491 lines of text report... seems like a lose-lose situation LOL (I thought `git` would save me time). How do I decipher this? – WinWin Jul 26 '11 at 18:21
  • 1
    Is there a clone of the repo somewhere? – Andy Jul 26 '11 at 18:24
  • @Andy No. only pushed it once, a while ago (mainly for learning, I don't need to share it yet). – WinWin Jul 26 '11 at 18:28
  • The contents of the object are junk? or are they something that is in your tree? – Andy Jul 26 '11 at 18:30
  • Actually if the error doesn't show up anymore, it could have just been some corruption in memory. If `git fsck` doesn't return any errors, I would guess that is what happened. And make a backup of your repo:) – Andy Jul 26 '11 at 18:35

1 Answers1

3

Since git fsck is clean and you don't see the error anymore, I would venture to guess that there was some corruption in memory.

I know you said that you only have been working locally and don't want to share, but it is still a good idea to have a backup that is at least on a different disk and preferably a different physical location. If you don't mind your project being open source you can use github or free.

Links on backing up a git repo

Community
  • 1
  • 1
Andy
  • 44,610
  • 13
  • 70
  • 69