可能重复:
Getting rid of ‘… does not point to a valid object’ for an old git branch
当我尝试从GitHub克隆项目时,我遇到以下错误:
$ git clone https://github.com/lukaszkujawa/Beehive.git
Cloning into Beehive...
remote: Counting objects: 149, done.
remote: Compressing objects: 100% (114/114), done.
remote: Total 149 (delta 31), reused 132 (delta 15)
Receiving objects: 100% (149/149), 108.13 KiB | 131 KiB/s, done.
Resolving deltas: 100% (31/31), done.
error: refs/remotes/origin/master does not point to a valid object!
error: Trying to write ref refs/heads/master with nonexistant object 3985fe8fad9d1480fb76d849ba4dbbdebfee2efd
fatal: Cannot update the ref 'HEAD'.
我希望这是一个常见的问题但令人惊讶的是我在谷歌上发现的一切都假设.git目录就在那里。从我的理解.git始终是项目的本地,在这种情况下,它无法下载它。我在不同的服务器上试过它,它的工作原理。
奇怪的是,当我尝试克隆其他任何东西时都没有问题。
$ git clone https://github.com/lukaszkujawa/php-mp3info.git
Cloning into php-mp3info...
remote: Counting objects: 23, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 23 (delta 8), reused 19 (delta 4)
Unpacking objects: 100% (23/23), done.
我想了解这个特定服务器上的特定项目有什么特别之处,它无法克隆它。
EDIT1:
git clone with GIT_TRACE = 2
$ GIT_TRACE=2 git clone https://github.com/lukaszkujawa/Beehive.git
trace: built-in: git 'clone' 'https://github.com/lukaszkujawa/Beehive.git'
Cloning into Beehive...
trace: run_command: 'git-remote-https' 'origin' 'https://github.com/lukaszkujawa/Beehive.git'
trace: run_command: 'fetch-pack' '--stateless-rpc' '--lock-pack' '--thin' 'https://github.com/lukaszkujawa/Beehive.git/' 'refs/heads/master'
trace: exec: 'git' 'fetch-pack' '--stateless-rpc' '--lock-pack' '--thin' 'https://github.com/lukaszkujawa/Beehive.git/' 'refs/heads/master'
trace: built-in: git 'fetch-pack' '--stateless-rpc' '--lock-pack' '--thin' 'https://github.com/lukaszkujawa/Beehive.git/' 'refs/heads/master'
remote: Counting objects: 149, done.
remote: Compressing objects: 100% (114/114), done.
trace: run_command: 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 9248 on vmserver01' '--pack_header=2,149'
trace: exec: 'git' 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 9248 on vmserver01' '--pack_header=2,149'
trace: built-in: git 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 9248 on vmserver01' '--pack_header=2,149'
remote: Total 149 (delta 31), reused 132 (delta 15)
Receiving objects: 100% (149/149), 108.13 KiB, done.
Resolving deltas: 100% (31/31), done.
error: refs/remotes/origin/master does not point to a valid object!
error: Trying to write ref refs/heads/master with nonexistant object 3985fe8fad9d1480fb76d849ba4dbbdebfee2efd
fatal: Cannot update the ref 'HEAD'.
EDIT2:
$ git --version
git version 1.7.9.1