Recovering Git repository from objects only

独自空忆成欢 提交于 2019-11-28 10:31:19

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.

If you haven't already tried git checkout master, I'd start with that.

The Lazy Coder

try using this post

How to recover Git objects damaged by hard disk failure?

that answer may have some *nix related info. Let me know if it helps.

Ill see what it does.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!