I have this error while pushing my project to tfs GIT.
fatal: Out of memory, malloc failed (tried to allocate 889192448 bytes)
I had the same problem on windows, exept with checkout another branch. Finally, I couldn't either pull or fetch my project beacause I got out of memory error ("try to allocate..." etc). I did the trick with increasing git pack and core limits but it didn't work for me. Finally, I deleted git from computer and install again. Problem was solved.
In my experience this can happen for a few reasons:
.gitignore
file in that new repo and then copy my files over there. Not a good solution but it was my best solution until I can identify a way to completely remove it from all history.I'm not saying these are the only possibilities. But in my experience with at least a few hundred repositories it was one of these two things every time. Usually #1.
To see which files are the largest in your repository execute this command: ls -lS
Edit .git/config
on Unix or .gitconfig
on Windows and modifiy the following params. By running git config --list --show-origin
you could locate your gitconfigs.
[core]
packedGitLimit = 128m
packedGitWindowSize = 128m
[pack]
deltaCacheSize = 128m
packSizeLimit = 128m
windowMemory = 128m
[http]
postbuffer = 5m
If you are using git via CLI ensure you restart your shell/terminal after you changed this settings.