5

Tried below command and facing error.

C:\project\sys\src>git gc

Counting objects: 6342699, done.

warning: suboptimal pack - out of memory

fatal: Out of memory, malloc failed (tried to allocate 239971384 bytes)

error: failed to run repack

I have tried

  1. git config --global pack.windowMemory 256m

  2. git repack -a -f -d

  3. update the latest git extension

  4. git gc --aggressive --prune=now

I have tried so many options.But still my facing this issue. any idea why i'm getting this error?

Community
  • 1
  • 1
Selva
  • 169
  • 1
  • 3
  • 12
  • 1
    At a guess: someone committed a massive file to git? Don't commit 200 gigabyte files to source control, that's what artifact repositories are for. You should copy the files out of git and start a new repository without the massive binary files. Abandon the old repository. – Paul Hicks Feb 25 '14 at 08:53
  • Thanks for ur reply @PaulHicks. Can you please tell me. How to do this? – Selva Feb 26 '14 at 06:27
  • Depends on how big it is. Roughly speaking, make a copy of the repo, delete the .git directory, look for binary files that should be deleted and delete them, then run `git init` again, thereby creating a new repo. There are many variations on this theme, one of the alternatives may work for you. – Paul Hicks Feb 26 '14 at 07:16
  • Let me know if this works, I'll create an answer if it does, or if it helps you figure out what's wrong. – Paul Hicks Feb 26 '14 at 07:16
  • possible duplicate of [Repack of Git repository fails](http://stackoverflow.com/questions/4826639/repack-of-git-repository-fails) – Joe Sep 30 '14 at 14:49
  • FWIW, your #4 worked for me when nothing else would. After I ran `git gc --aggressive --prune=now`, I was able to run `git gc` without errors. – Ken Smith Oct 11 '18 at 17:09

0 Answers0