【问题标题】:git-push errors out with failed to read objectgit-push 错误,读取对象失败
【发布时间】:2013-07-29 22:06:10
【问题描述】:

我在 github 有一个新的仓库。我正在尝试第一次将我的本地仓库推送到 github。我收到以下错误。

$git push -u origin master
fatal: failed to read object 25560dba99aa5e7e94e77cf9b238c7baf5bff137:                   Invalid argument
error: failed to push some refs to 'git@github.com:vivek/fii.git'

我确实有一些损坏的对象,我求助于最后一次成功的提交。 恢复后我的本地 git 工作正常,但 git-push 失败。

git fsck
fatal: failed to read object 0f1ebff038a9624485861b5f5b8a2859cbe4b49c: Invalid argument

我厌倦了从 .git/objects 中删除大小为 0 的文件,但这也不起作用。

-谢谢

【问题讨论】:

  • 你能排除“-u”标志吗?
  • 没有“-u”标志我仍然得到同样的错误:

标签: git git-push


【解决方案1】:

我终于让它工作了。我从.git/objects 中删除了损坏的对象。另外,我将.git/refs/heads/master 指向最新的工作提交。在此命令工作正常之后。

$git push -u origin master
Counting objects: 113, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (97/97), done.
Writing objects: 100% (98/98), 773.36 KiB, done.
Total 98 (delta 54), reused 0 (delta 0)

【讨论】:

    猜你喜欢
    • 2011-11-21
    • 1970-01-01
    • 2017-06-02
    • 2014-07-20
    • 1970-01-01
    • 1970-01-01
    • 2021-03-15
    • 2013-03-21
    • 2014-04-30
    相关资源
    最近更新 更多