Git fatal: early EOF
- 2022年6月20日
- 技術情報
When I was trying to clone a repository from a remote server, I got this error fatal: early EOF fatal: index-pack failed
. Normally this problem happens when the remote repository is too large and let me share with you today how I solved this issue.
You can see the full error log in below screenshot.

There are some ways to solve this issue.
If you are the owner the repository, you can configure some settings like
git gc
git gc
will also perform compression on stored Git Objects, freeing up precious disk space. For more detail, you can reference here.
git repack ...
This used to combine all objects that do not currently reside in a “pack”, into a pack. It can also be used to re-organize existing packs into a single, more efficient pack. Packs are used to reduce the load on mirror systems, backup engines, disk storage, etc. Please reference more here.
If you are not the owner of the repository just a client, you still can configure post buffer setting and git depth setting like below.
//updating the post buffer setting
git config --global http.postBuffer 524288000
//cloning using depth
git clone --depth 1 <repo_url>
Depth is a feature of git to reduce server load. Instead of cloning the complete repository (as usually done with git), using clone depth just clones the last clone-depth-number revisions of your repository, also called shallow clone.
Yuuma
yuuma at 2022年06月20日 10:00:00