Dirk Bergmann

Developer, panographer. Does consultancy work from own company. Lives in Chiang Mai, Thailand.


pack-objects died with strange error when running git push

If you get errors such as

fatal: Out of memory, malloc failed
error: pack-objects died with strange error
error: failed to push some refs to ?git@myserver.com:foo.git?

when running

git push

first, upgrade git to the latest version on both ends, then check if

git repack

still works. If not, you might have a local issue.

If repack still works, your remote server (the server you push to) might actually run out of memory, which can easily happen with for example smallish VPS slices. So, just increase your swap file as Linus suggests, like this and it might start working again. Hope it helps.