The first thing that I would try is to initialize a new repository with git init
. Then I'd copy the objects directory from the dead repository into the new repository. Then I'd run git fsck
in the new repository.
With some luck you'll see a whole lot of dangling objects and with a bit more luck some of the dangling objects will be commit objects which will be the tips of lost branches.
If you run git show
and/or git log
on these commits you may be able to recognize some of the branches.
To "recover" them you can just use git branch
to recreate named branches.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…