1

When I attempt to do a git clone on my git repository I get the following error:

$ 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

My clone fails and the local directory is not empty. Anyway to fix

BalaB
  • 3,687
  • 9
  • 36
  • 58

1 Answers1

2

This is typical of a symbolic link or a submodule entry incorrectly added (as in this example): you can check how 'bin' is represented in the remote hosting service (GitHUb? GitLab? BitBucket) to confirm this.

If you can apply the solution from "How to remove an entry with null sha1 in a Git tree" (even in your empty working tree) and if you have the right to force push (git push --force) the result, you might be able to fix that repo for others.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250