On Mon, 7 Apr 2014 19:41:27 -0700 (PDT)
fpefpe <fpespos...@gmail.com> wrote:

> One of my GIT repo got corrupted -- are there any tools to figure out
> what when wrong?

In addition to what John asked -- what do you mean by "corrupted"?
The problem is that this word mean different things to different people.

If you mean that Git behaves strangely on that repository and hence you
might suspect a faulty storage or filesystem (or both) then the check
list is:

1) Copy (literally) the whole project directory onto a
   filesystem/storage which is in the known good state.
2) Copy it again somewhere else to have a "reference" "post-mortem"

   Any recovery procedures are then to be taken on the copy obtained on
   step (1).  If you think you've spoiled it during the steps you'll
   be carying, just replace it with the copy obtained on step (2)
   and start over.

Now the only thing Git provides for you to try to repare a damaged repo
is `git fsck` ("fsck" is an ond Unix-y acronym of File System
ChecK [*]).  You can run this tool to try to recover as much objects as
it will be able to.  The usual way to call it is with the "--lost-found"
command-line option -- see the manual page.
After it finished, you'll be able to inspect what it resurrected and
possibly scavenge something from that.
If not, or it the tool failed you're most probably out of luck.

In any case, if you have a clone somewhere it's better to just re-clone
the repository.  You should only mess with `git fsck` if your repo
contained some precious unpushed data you'd like to recover.

[*] Yet some people beleive it's named this way because it may
    fsck a filesystem up beyond any recognition; YMMV.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to