{"id":41912,"date":"2017-11-23T18:01:47","date_gmt":"2017-11-23T10:01:47","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=41912"},"modified":"2019-10-21T16:20:53","modified_gmt":"2019-10-21T08:20:53","slug":"git-clone-early-eofs-fatal-error","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/","title":{"rendered":"Fixing Git Clone &#8220;Early EOFs&#8221; Fatal Error"},"content":{"rendered":"<p>The \u201c<a target=\"_blank\" href=\"https:\/\/www.atlassian.com\/git\/tutorials\/setting-up-a-repository\/git-clone\" rel=\"noopener noreferrer\">git clone<\/a>\u201d command \u2013 as its name suggest \u2013 allows you to duplicate an entire repository from remote to local, or vice versa. Although it is a fairly simple and straight forward git command, sometimes, problems may still arise.<\/p>\n<p>Earlier this week, I was hit with an error while executing <em>git clone<\/em>, and the error looks like the following:<\/p>\n<pre>\r\nerror: pack-objects died of signal 9.20 MiB | 79.00 KiB\/s      \r\nerror: git upload-pack: git-pack-objects died with error.\r\nfatal: git upload-pack: aborting due to possible repository corruption on the remote side.\r\nremote: aborting due to possible repository corruption on the remote side.\r\nfatal: early EOFs:   1% (66\/3818), 6.04 MiB | 53.00 KiB\/s<\/pre>\n<p>After some researching and debugging, here are the two main causes of the fatal error.<\/p>\n<h2>1. Slow Internet connection<\/h2>\n<h3>Cause of error<\/h3>\n<p>The repository  is huge and Internet connection is simply too slow.<\/p>\n<p>This came from my personal experience \u2013 I was attempting to clone a repository of about 1.5Gb. It kept failing at inconsistently at different rate of downloaded %, sometimes after 20Mb, sometimes after 60Mb, 200Mb, etc.<\/p>\n<h3>Solution<\/h3>\n<p>Changing to a faster and more stable Internet connection helps. With a faster connection, I was able to get closer to 1.5Gb. At one point I\u2019m able to clone without any error.<\/p>\n<h2>2. Huge repository<\/h2>\n<h3>Cause of error<\/h3>\n<p>The repository you are trying to clone is large, in terms of file size. While attempting to clone it, the remote server simply doesn\u2019t have enough memory to cope with the execution.<\/p>\n<h3>Solution<\/h3>\n<p>Turn of compression. Git clone partially. When it is successful, clone the rest.<\/p>\n<ol>\n<li>\n<p>First, turn off Git compression.<\/p>\n<pre>git config --global core.compression 0<\/pre>\n<\/li>\n<li>\n<p>Then do a partial clone of the repository with <code>--depth 1<\/code> parameter. Replace <code>username@domain.com\/path\/to\/git_repo\/<\/code> with the actual path to the repository.<\/p>\n<pre>git clone -depth 1 ssh:\/\/username@domain.com\/path\/to\/git_repo\/<\/pre>\n<\/li>\n<li>\n<p>Next, retrieve the rest of the repository.<\/p>\n<pre>git fetch --unshallow<\/pre>\n<\/li>\n<li>\n<p>Finally, finish it up with a regular pull.<\/p>\n<pre>git fetch --unshallow<\/pre>\n<\/li>\n<\/ol>\n<p>These methods solved my problem. Hope it helps!<\/p>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/manage-git-github-atom\/\" rel=\"noopener noreferrer\">How to Manage Git and GitHub Projects with Atom<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>The \u201cgit clone\u201d command \u2013 as its name suggest \u2013 allows you to duplicate an entire repository from remote to local, or vice versa. Although it is a fairly simple and straight forward git command, sometimes, problems may still arise. Earlier this week, I was hit with an error while executing git clone, and the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3400],"tags":[2081],"topic":[4521],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Fixing Git Clone &quot;Early EOFs&quot; Fatal Error - Hongkiat<\/title>\n<meta name=\"description\" content=\"The &quot;git clone&quot; command - as its name suggest - allows you to duplicate an entire repository from remote to local, or vice versa. Although it is a fairly\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fixing Git Clone &quot;Early EOFs&quot; Fatal Error\" \/>\n<meta property=\"og:description\" content=\"The &quot;git clone&quot; command - as its name suggest - allows you to duplicate an entire repository from remote to local, or vice versa. Although it is a fairly\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-23T10:01:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-21T08:20:53+00:00\" \/>\n<meta name=\"author\" content=\"Hongkiat Lim\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hongkiat Lim\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/git-clone-early-eofs-fatal-error\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/git-clone-early-eofs-fatal-error\\\/\"},\"author\":{\"name\":\"Hongkiat Lim\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e3613a3bf757e4f67770f0b7a339edd0\"},\"headline\":\"Fixing Git Clone &#8220;Early EOFs&#8221; Fatal Error\",\"datePublished\":\"2017-11-23T10:01:47+00:00\",\"dateModified\":\"2019-10-21T08:20:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/git-clone-early-eofs-fatal-error\\\/\"},\"wordCount\":275,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"keywords\":[\"Git\"],\"articleSection\":[\"Hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/git-clone-early-eofs-fatal-error\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/git-clone-early-eofs-fatal-error\\\/\",\"name\":\"Fixing Git Clone \\\"Early EOFs\\\" Fatal Error - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"datePublished\":\"2017-11-23T10:01:47+00:00\",\"dateModified\":\"2019-10-21T08:20:53+00:00\",\"description\":\"The \\\"git clone\\\" command - as its name suggest - allows you to duplicate an entire repository from remote to local, or vice versa. Although it is a fairly\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/git-clone-early-eofs-fatal-error\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/git-clone-early-eofs-fatal-error\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/git-clone-early-eofs-fatal-error\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fixing Git Clone &#8220;Early EOFs&#8221; Fatal Error\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e3613a3bf757e4f67770f0b7a339edd0\",\"name\":\"Hongkiat Lim\",\"description\":\"Founder and Editor in Chief of Hongkiat.com. Hongkiat is also a designer, developer, entrepreneur, and an active investor in the US stock market.\",\"sameAs\":[\"http:\\\/\\\/www.hongkiat.com\\\/blog\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/hongkiat\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fixing Git Clone \"Early EOFs\" Fatal Error - Hongkiat","description":"The \"git clone\" command - as its name suggest - allows you to duplicate an entire repository from remote to local, or vice versa. Although it is a fairly","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/","og_locale":"en_US","og_type":"article","og_title":"Fixing Git Clone \"Early EOFs\" Fatal Error","og_description":"The \"git clone\" command - as its name suggest - allows you to duplicate an entire repository from remote to local, or vice versa. Although it is a fairly","og_url":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2017-11-23T10:01:47+00:00","article_modified_time":"2019-10-21T08:20:53+00:00","author":"Hongkiat Lim","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Hongkiat Lim","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/"},"author":{"name":"Hongkiat Lim","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e3613a3bf757e4f67770f0b7a339edd0"},"headline":"Fixing Git Clone &#8220;Early EOFs&#8221; Fatal Error","datePublished":"2017-11-23T10:01:47+00:00","dateModified":"2019-10-21T08:20:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/"},"wordCount":275,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"keywords":["Git"],"articleSection":["Hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/","url":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/","name":"Fixing Git Clone \"Early EOFs\" Fatal Error - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"datePublished":"2017-11-23T10:01:47+00:00","dateModified":"2019-10-21T08:20:53+00:00","description":"The \"git clone\" command - as its name suggest - allows you to duplicate an entire repository from remote to local, or vice versa. Although it is a fairly","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/git-clone-early-eofs-fatal-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Fixing Git Clone &#8220;Early EOFs&#8221; Fatal Error"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e3613a3bf757e4f67770f0b7a339edd0","name":"Hongkiat Lim","description":"Founder and Editor in Chief of Hongkiat.com. Hongkiat is also a designer, developer, entrepreneur, and an active investor in the US stock market.","sameAs":["http:\/\/www.hongkiat.com\/blog"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/hongkiat\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-aU0","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/41912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=41912"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/41912\/revisions"}],"predecessor-version":[{"id":48898,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/41912\/revisions\/48898"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=41912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=41912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=41912"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=41912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}