{"id":12208,"date":"2022-06-20T10:00:00","date_gmt":"2022-06-20T01:00:00","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=12208"},"modified":"2022-06-17T18:10:27","modified_gmt":"2022-06-17T09:10:27","slug":"git-fatal-early-eof","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/12208","title":{"rendered":"Git fatal: early EOF"},"content":{"rendered":"\n<p>When I was trying to clone a repository from a remote server, I got this error <code>fatal: early EOF fatal: index-pack failed<\/code>. Normally this problem happens when the remote repository is too large and let me share with you today how I solved this issue.<\/p>\n\n\n\n<p>You can see the full error log in below screenshot. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1070\" height=\"166\" src=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2022\/06\/image.png\" alt=\"\" class=\"wp-image-12209\" \/><\/figure>\n\n\n\n<p>There are some ways to solve this issue.<\/p>\n\n\n\n<p>If you are the owner the repository, you can configure some settings like <\/p>\n\n\n\n<p><code>git gc<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><code>git gc<\/code>&nbsp;will also perform compression on stored Git Objects, freeing up precious disk space. For more detail, you can reference <a href=\"https:\/\/www.atlassian.com\/git\/tutorials\/git-gc#:~:text=The%20git%20gc%20command%20is,which%20do%20dynamic%20memory%20allocation.\">here<\/a>.<\/p>\n\n\n\n<p><code>git repack ... <\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>This used to combine all objects that do not currently reside in a &#8220;pack&#8221;, 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 <a href=\"https:\/\/git-scm.com\/docs\/git-repack#:~:text=DESCRIPTION,a%20single%2C%20more%20efficient%20pack.\">here<\/a>.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/updating the post buffer setting\ngit config --global http.postBuffer 524288000<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/cloning using depth\ngit clone --depth 1 &lt;repo_url&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Depth is a feature of git to&nbsp;reduce server load.&nbsp;Instead of cloning the complete repository (as usually done with git), using clone depth just clones the last&nbsp;<em>clone-depth-number<\/em>&nbsp;revisions of your repository, also called <a href=\"https:\/\/www.perforce.com\/blog\/vcs\/git-beyond-basics-using-shallow-clones\">shallow clone<\/a>.<\/p>\n\n\n\n<p>Yuuma<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/12208\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/12208\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"Git fatal: early EOF\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/12208\" data-text=\"Git fatal: early EOF\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/12208\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/12208\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>When I was trying to clone a repository from a remote server, I got this error fatal: early EOF fatal: index-p [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/12208"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=12208"}],"version-history":[{"count":2,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/12208\/revisions"}],"predecessor-version":[{"id":12234,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/12208\/revisions\/12234"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=12208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=12208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=12208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}