git clone fails with "index-pack" failed? git clone fails with "index-pack" failed? git git

git clone fails with "index-pack" failed?


The way I solved this problem is this: My git daemon is running on windows, and clients are on other computers.

I found a workaround (but it will only work on windows).

Start git daemon with verbose from cmd.exe:

"C:\Program Files\Git\bin\sh.exe" --login -i -c 'git.exe daemon --verbose  '

Not tested, if it works directly in git bash. Maybe it will.

Then (before starting any clone, pull, fetch,...) select some text in the window (note: "Quick Edit Mode" must be enabled (can be found in: cmd.exe --> Properties (click the top left corner of your cmd window) --> Edit Options)) in which git daemon runs. That will prevent it from printing any further messages in that window.

When the output thread of git daemon is blocked that way, then the error does not happen


Does "git gc" complain?


I have the same problem as you; the error message when I clone i:

Cloning into test...remote: Counting objects: 6503, done.remote: Compressing objects: 100% (4519/4519), done.Connection to git.myhost.im closed by remote host.| 350 KiB/sfatal: The remote end hung up unexpectedlyfatal: early EOFfatal: index-pack failed

In my case, the reason is that my repository size (200M) is larger than my git server's memory (128M). When I clone from the git server, I use command top on my server, which shows that memory usage is soon over 128M.

When I use another server that has 4G memory, the git clone is all okay. You could also try adding more swap space to your sever.