GIT:`error:找不到<;提交>;`和`致命:对象<;承诺>;拉动时未找到

GIT:`error:找不到<;提交>;`和`致命:对象<;承诺>;拉动时未找到,git,bitbucket,git-pull,Git,Bitbucket,Git Pull,我们在Bitbucket中有一个回购协议,我们将其用作中央回购协议: 我们通过拉式请求或直接通过推式更改来更新它 我们通过从远程服务器中提取来同步最后的更改 大约一年来,它一直像一个魔咒一样工作,但现在我们无法从这个repo中提取更改来更新远程服务器: $ git pull origin remote: Total 0 (delta 0), reused 0 (delta 0) error: unable to find a1354e341c6773997c31a109e615d1bf9acb0

我们在Bitbucket中有一个回购协议,我们将其用作中央回购协议:

  • 我们通过拉式请求或直接通过推式更改来更新它
  • 我们通过从远程服务器中提取来同步最后的更改 大约一年来,它一直像一个魔咒一样工作,但现在我们无法从这个repo中提取更改来更新远程服务器:

    $ git pull origin
    remote: Total 0 (delta 0), reused 0 (delta 0)
    error: unable to find a1354e341c6773997c31a109e615d1bf9acb0119
    fatal: object a1354e341c6773997c31a109e615d1bf9acb0119 not found
    
    尽管如此,这个对象/提交还是可以从Bitbucket和我的本地机器(在那里我生成了它,然后推送到中央repo)中获得

    我已经处理这个问题8个多小时了。我对Git的了解还不足以做一些基本的事情,所以我盲目地尝试了很多可能的解决方案,这些解决方案与我在Web上发现的情况相同,但都没有产生效果。我试过这样的方法:

    $ git gc
    $ git fsck --full
    $ git reflog expire --expire=0 --all
    
    我还将回购重置为以前的状态,并再次应用更改,但也不起作用

    关于这个问题有什么线索吗

    编辑:

    乔纳森·斯温尼问我,当我试图复制回购协议时会发生什么。嗯,这有点奇怪。如果我在本地机器上克隆它,它可以正常工作,但无法通过SSH在远程服务器上工作:

    $ git clone https://******@bitbucket.org/******/******.git
    Initialized empty Git repository in /root/a/idpro/.git/
    Password: 
    remote: Counting objects: 19853, done.
    remote: Compressing objects: 100% (7525/7525), done.
    remote: Total 19853 (delta 12910), reused 15843 (delta 10336)
    Receiving objects: 100% (19853/19853), 21.12 MiB | 6.00 MiB/s, done.
    Resolving deltas: 100% (12910/12910), done.
    error: refs/remotes/origin/master does not point to a valid object!
    error: Trying to write ref refs/heads/master with nonexistant object c16203dc93b1557fc1d01102ea460663a8112e50
    fatal: Cannot update the ref 'HEAD'.
    

    您可以注意到,
    c16203dc93b1557fc1d01102ea460663a8112e50
    与上面的不同(
    a1354e341c6773997c31a109e615d1bf9acb0119
    ),因为我从另一个本地回购中提取更改,并将更改推到中心回购,作为解决问题的一部分。

    结果是版本控制问题。一旦我们更新了GIT版本,它就可以正常工作。

    sudo-yum-upgrade–skip-break–y GIT

    然后再做一次git-version,它会告诉你一些>1.8的东西


    然后尝试git拉原点

    “当你从头克隆存储库时会发生什么?”我在问题中回答道。非常感谢。