Git pull fatal: Out of memory, malloc failed

前端 未结 4 2094
半阙折子戏
半阙折子戏 2021-02-04 13:11

I\'ve a repo on https://bitbucket.org/

Few days ago by a mistake big number of image files were pushed in the repo. then files were deleted via another push. after that

4条回答
  •  梦谈多话
    2021-02-04 14:04

    I recently encountered this issue with one of my repositories. Similar error, hinting at a large file hidden in the repo somewhere.

    Cloning into 'test_framework'...
    remote: Counting objects: 11889, done.
    remote: Compressing objects: 100% (5991/5991), done.
    Receiving objects:  66% (7847/11889), 3.22 MiB | 43 KiB/sremote: fatal: Out of memory, malloc failed     (tried to allocate 893191377 bytes)
    remote: aborting due to possible repository corruption on the remote side.
    fatal: early EOFs:  66% (7933/11889), 3.24 MiB
    fatal: index-pack failed
    

    To get around this I temporarily created a large swap drive (in excess of the 893191377 bytes the server was asking for) following Method 2 from here: http://www.thegeekstuff.com/2010/08/how-to-add-swap-space/

    This allowed me to successfully clone and then remove the culprit (someone had checked in an sql dumpfile). You can use:

    git filter-branch --tree-filter 'rm -rf dumpfile.sql' HEAD
    

    to remove the file from the git repo.

提交回复
热议问题