GIT:`错误:无法找到< commit>和`fatal:object< commit>没有找到`在拉 [英] GIT: `error: unable to find <commit>` and `fatal: object <commit> not found` on pull
问题描述
我们在Bitbucket中有一个回购,我们用它作为中央回购:
- 我们通过拉请求或直接推更改和
- 我们通过从远程服务器上拉取它们来同步上次更改。
这已经像一个魅力工作了大约一年,但现在我们无法从此回购更改更新远程服务器:
$ git pull origin
remote:共0(delta 0),重用0(delta 0)
错误:无法找到a1354e341c6773997c31a109e615d1bf9acb0119
致命对象a1354e341c6773997c31a109e615d1bf9acb0119找不到
,这个对象/提交可以从Bitbucket中获得,也可以在我的本地机器(我生成它然后推送到中央仓库)中获得。
我一直在处理这个问题问题超过8小时。我对Git的知识几乎不足以做基本的事情,所以我盲目地尝试了很多可能的解决方案,这些解决方案可以在网络上发现的同一情况下为其他人工作,但他们都没有产生结果。我试过这样的东西:
$ git gc
$ git fsck --full
$ git reflog expire --expire = 0 - all
我也重置到回购的前一个状态,
这个子喷射的任何线索?
编辑:
Jonathan Swinney问我,当我试图克隆回购时发生了什么。那么,这有点奇怪。如果我在本地机器上克隆它,它可以正常工作,但它不能通过SSH在远程服务器上工作:
$ git克隆https://******@bitbucket.org/******/******.git
/root/a/idpro/.git/中初始化的空Git存储库
密码:
remote:计数对象:19853,完成。
remote:压缩对象:100%(7525/7525),完成。
remote:共计19853(delta 12910),重用15843(delta 10336)
接收对象:100%(19853/19853),21.12 MiB | 6.00 MiB / s,完成。
解决三角洲问题:完成100%(12910/12910)。
错误:refs / remotes / origin / master没有指向有效的对象!
错误:尝试使用不敏感对象编写ref refs / heads / master c16203dc93b1557fc1d01102ea460663a8112e50
致命:无法更新ref'HEAD'。
您可以注意到 c16203dc93b1557fc1d01102ea460663a8112e50
不是( a1354e341c6773997c31a109e615d1bf9acb0119
),因为我从另一个本地仓库中取出并将更改推送到中央仓库,作为我尝试解决问题的一部分。
We have a repo in Bitbucket, which we use as a central repo:
- we update it via pull requests or directly by pushing changes, and
- we synchronize the last changes in remote servers by pulling from it.
This has been working like a charm for about a year, but now we are not able to pull changes from this repo to update a remote server:
$ git pull origin
remote: Total 0 (delta 0), reused 0 (delta 0)
error: unable to find a1354e341c6773997c31a109e615d1bf9acb0119
fatal: object a1354e341c6773997c31a109e615d1bf9acb0119 not found
Nonetheless, this object/commit is available from Bitbucket and also in my local machine (where I generated it and then pushed to the central repo).
I have been dealing with this issue for more than 8 hours. My knowledge of Git is barely enough to do basic things so I tried blindly a lot of possible solutions that worked for other people in the same situation that I found on the Web, but none of them has produced results. I tried things like:
$ git gc
$ git fsck --full
$ git reflog expire --expire=0 --all
I also reset to the previous state of the repo and re-apply the changes again but it didn't work either.
Any clue on this subjet?
EDIT:
Jonathan Swinney asked me what happens when I try to clone the repo. Well, it is kinda weird. If I clone it in my local machine it works OK but it won't work on a remote server via 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'.
You can notice that c16203dc93b1557fc1d01102ea460663a8112e50
is not the same head as above (a1354e341c6773997c31a109e615d1bf9acb0119
) since I pulled from another local repo and pushed the changes to the central one as part of my attempts to solve the problem.
It turned out to be a versioning problem. Once we updated our GIT versions it worked just right.
这篇关于GIT:`错误:无法找到< commit>和`fatal:object< commit>没有找到`在拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!