title: git out of memory on checkout
body: <p>I have cloned a large repo and got an error (after several attempts) </p>
  
  <blockquote>
    <p>Clone succeeded, but checkout failed</p>
  </blockquote>
  
  <p>When trying to fix this with</p>
  
  <pre><code>git checkout -f HEAD
  </code></pre>
  
  <p>an error comes back</p>
  
  <blockquote>
    <p>Fatal: Out of memory, realloc failed2</p>
  </blockquote>
  
  <p>I've already set some memory limits higher because the cloning also ran into problems by setting</p>
  
  <pre><code>git config pack.WindowMemory 256m &amp;&amp; git config pack.packSizelimit 256m
  </code></pre>
  
  <p>Based on advice below from Punit Vara (below) I've also edited the .git/config to:</p>
  
  <pre><code>[core]
  packedGitLimit = 128m
    packedGitWindowSize = 128m
  
  [pack]
    deltaCacheSize = 128m
    packSizeLimit = 128m
    windowMemory = 128m
  </code></pre>
  
  <p>And I've tried changing these values to: 128m, 256m, 512m, 1024m. This didn't work for me. I still get the same error that seems to appear at 41%.</p>
  
  <p>Anyone has experience with this or any idea where this is going wrong and/or what can be done to solve this? Thanks. </p>