在git clone上收到“缓存条目具有空sha1值”

时间:2018-07-17 04:23:44

标签: git bitbucket

当我尝试在git存储库上进行git克隆时,出现以下错误:

$ git clone https://xxxxxxxxx:8081/scm/xxxxxx/xxxx-apac.git
Cloning into 'xxxx-apac'...
remote: Counting objects: 740, done.
remote: Compressing objects: 100% (471/471), done.
remote: Total 740 (delta 304), reused 466 (delta 201)
Receiving objects: 100% (740/740), 5.28 MiB | 1.11 MiB/s, done.
Resolving deltas: 100% (304/304), done.
error: cache entry has null sha1: bin
fatal: unable to write new index file
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'


/c/Users/bala/Bala/project
$ cd xxxx-apac/

/c/Users/bala/Bala/project/xxxx-apac (xxxx_Apr2018)
$ git branch --all
* xxxx_Apr2018
  remotes/origin/HEAD -> origin/xxxx_Apr2018
  remotes/origin/master
  remotes/origin/xxxx_Apr2018
  remotes/origin/xxxxx_mReleases2018

我的克隆失败,并且本地目录不为空。无论如何要修复

1 个答案:

答案 0 :(得分:1)

这是错误地添加符号链接或子模块条目(如in this example)的典型现象:您可以检查“ bin”在远程托管服务(GitHUb?GitLab?BitBucket)中如何表示以确认这一点。

如果您可以应用“ How to remove an entry with null sha1 in a Git tree”中的解决方案(即使在空的工作树中),则 ,如果您有权强制推送(git push --force)结果,您也许可以为其他人修复该存储库。