从日志文件中重新生成损坏的Git Repo?

时间:2016-09-02 04:51:10

标签: git corruption fsck

我在Windows上点击随机蓝屏,当我重新启动时,我的git repo已损坏。这是一个仅限本地的仓库,我的备份有几个星期了。我已经尝试了许多不同的东西(记录如下)以使其正常工作,但无济于事。重新克隆本地仓库会产生与原始仓库相同的损坏。我不能对回购做任何新的事情。

但是,func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { if (url.scheme == "yuvitime") { print("URL scheme:\(url.scheme)") let yuvitimeRequestValue = url.query! let userInfor = [ "YuvitimeRequest" : yuvitimeRequestValue ] let notificationCentre = NSNotificationCenter.defaultCenter() notificationCentre.postNotificationName("URLSCHEMEACTIVATEDNOTIFICATION", object: self, userInfo: userInfor) return true } else { return false } } git log似乎仍能正常运作。有没有什么方法可以从这些命令的输出中重新创建一个新的git repo?

我试图让它再次运作:

git status不起作用:

git show

我也试过以下内容,但没有帮助:

> git status --long -v
error: inflate: data stream error (incorrect header check)
fatal: failed to read object 143fd2fe59980f9b4aec9b1b696e4d2ab5bd0465: 
> git fsck --full
error: inflate: data stream error (incorrect header check)
error: unable to unpack 143fd2fe59980f9b4aec9b1b696e4d2ab5bd0465 header
error: inflate: data stream error (incorrect header check)
fatal: loose object 143fd2fe59980f9b4aec9b1b696e4d2ab5bd0465 (stored in .git/objects/14/3fd2fe59980f9b4aec9b1b696e4d2ab5bd0465) is
corrupt
> mv .git/objects/14/3fd2fe59980f9b4aec9b1b696e4d2ab5bd0465 .git/objects/14/3fd2fe59980f9b4aec9b1b696e4d2ab5bd0465.bak
> git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (56357/56357), done.
broken link from    tree 85532cceff0ea16036538bfb47adc1f1ecdb1009
              to    tree 143fd2fe59980f9b4aec9b1b696e4d2ab5bd0465
...
missing tree 143fd2fe59980f9b4aec9b1b696e4d2ab5bd0465
...

0 个答案:

没有答案