title: git pull and clone error fatal: early EOF; fatal: unpack-objects failed
body: <p>sorry to trouble you genius..</p>
  
  <p>i am coming across a common problem that there is many solution on stack overflow, but those solution all does not suit for me. So at the end i have no choice but ask help from you genius again on the stack overflow.</p>
  
  <ol>
  <li>i have a cloned repository on my server.</li>
  <li>when i changed some code on my development machine and push to the remote git repository, everything worked smoothly.</li>
  <li>the error start from when i pull data from the server. On the server, i command <code>git pull</code> the following error show up:</li>
  </ol>
  
  <p><code>remote: Counting objects: 66, done. 
  remote: Compressing objects: 100% (65/65), done. 
  Connection to bitbucket.org closed by remote host.
  fatal: The remote end hung up unexpectedly 
  fatal: early EOF
  fatal: unpack-objects failed</code></p>
  
  <ol start="4">
  <li>i tried this sloution: <a href="https://stackoverflow.com/questions/21277806/fatal-early-eof-fatal-index-pack-failed">fatal: early EOF fatal: index-pack failed</a> 
  but i get error form step 2 <code>git clone --depth 1 &lt;repo_URI&gt;</code></li>
  </ol>
  
  <p>the error is :</p>
  
  <p><code>Cloning into 'sinolife'...
  remote: Counting objects: 2783, done.
  remote: Compressing objects: 100% (2199/2199), done.
  Connection to bitbucket.org closed by remote host.00 KiB/s<br>
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed</code></p>
  
  <ol start="5">
  <li><p>I also get a solution that there isn't enough swap memory. so i create a swap memory. At the beginning the swap is 0...After i config the swap, the <code>free -m</code> result is:</p>
  
  <pre><code>     total       used       free     shared    buffers     cached
  </code></pre></li>
  </ol>
  
  <p>Mem:          993        930         63          0         21         57</p>
  
  <p>-/+ buffers/cache:        851        142</p>
  
  <p>Swap:          499         16        483</p>
  
  <p>but i also get the some error.</p>
  
  <pre><code>$git pull
  
  remote: Counting objects: 66, done.
  remote: Compressing objects: 100% (65/65), done.
  Connection to bitbucket.org closed by remote host.
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: unpack-objects failed
  
  $git clone
  
  Cloning into 'sinolife'...
  remote: Counting objects: 2783, done.
  remote: Compressing objects: 100% (2199/2199), done.
  Connection to bitbucket.org closed by remote host.00 KiB/s     
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed
  </code></pre>
  
  <ol start="6">
  <li>also <a href="https://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly-while-git-cloning">The remote end hung up unexpectedly while git cloning</a>, follow the step ,but error come again. the following is my git config file</li>
  </ol>
  
  <p>$git config -l</p>
  
  <pre><code>http.postbuffer=524288000
  user.email= myemail@myemail.com
  core.compression=0
  core.compression=-1
  core.compression=-1
  core.repositoryformatversion=0
  core.filemode=true
  core.bare=false
  core.logallrefupdates=true
  core.compression=-1
  core.packedgitlimit=512m
  core.packedgitwindowsize=512m
  remote.origin.url= my repository
  remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
  branch.master.remote=origin
  branch.master.merge=refs/heads/master
  pack.deltacachesize=2047m
  pack.packsizelimit=2047m
  pack.windowmemory=2047m
  </code></pre>
  
  <ol start="7">
  <li><p>my environment:</p>
  
  <p>uname -a</p>
  
  <p>Linux VM-87-192-ubuntu 3.13.0-86-generic #131-Ubuntu SMP Thu May 12 23:33:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux</p>
  
  <p>git --version</p>
  
  <p>git version 2.11.0</p></li>
  </ol>
  
  <p><strong><em>8. hope some one can help me give my some hint.</em></strong></p>
  
  <p><strong>9. question abstract</strong> </p>
  
  <p>i have a git repository, and already cloned in the server, but when <code>git pull</code></p>
  
  <pre><code>remote: Counting objects: 66, done.
  remote: Compressing objects: 100% (65/65), done.
  Connection to bitbucket.org closed by remote host.
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: unpack-objects failed
  </code></pre>
  
  <p>when start a new clone  <code>git clone</code></p>
  
  <pre><code>Cloning into 'sinolife'...
  remote: Counting objects: 2057, done.
  remote: Compressing objects: 100% (1740/1740), done.
  Connection to bitbucket.org closed by remote host.00 KiB/s     
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed
  </code></pre>