在推送和克隆git时出现致命错误

时间:2014-11-04 18:46:53

标签: git

我能够从git遥控器推拉,直到昨天。我不知道(或记得)我今天所做的事突然间我无法推送到远程git repo。我收到了以下错误

$ git push
Counting objects: 83, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (17/17), 1.32 KiB | 0 bytes/s, done.
Total 17 (delta 12), reused 0 (delta 0)
remote: fatal: unresolved deltas left after unpacking
error: unpack failed: unpack-objects abnormal exit
To //myserver/git/apps/myApp.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to '//myserver/git/apps/myApp.git'

当我再次尝试克隆时,我收到错误

$ Git clone //myserver/git/apps/myApp.git/
Cloning into 'MyApp'...
done.
fatal: unable to read tree 18295307f1270da3c09e3de91890652af4ff7ca8
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

两者

git status 

git checkout -f HEAD

给出错误

fatal: unable to read tree 18295307f1270da3c09e3de91890652af4ff7ca8

任何人都可以帮我理解出了什么问题,我该如何解决?

由于

1 个答案:

答案 0 :(得分:1)

所以我解决了这个问题。幸运的是,我的远程仓库是最新的,没有错误。使用验证对象命令

git fsck --full
我看到了悬垂的树。所以我想到服务器并将那些丢失的对象复制到我的本地副本。通过连续检查和复制,我能够带来所有缺失的对象,并最终能够推动。 Evey现在是最新的。

损坏我的本地副本的原因可能是我删除了分支。我做过的。