Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I went to my file directory, did

$ git init
$ git add

and then got

fatal: Out of memory? mmap failed: Cannot allocate memory

One folder is maybe 2GB big because it is full of images.. the rest are very small. What can be the problem here?

share|improve this question
add comment

1 Answer

Your system don't have enough memory for to pack all the data in your repository into one file, which is git's default setting.

To work around this problem, set the pack.packSizeLimit configuration option to a value that is well within the available memory of your system.. You can set it with this command:

git config pack.packSizeLimit 1g

You can use the suffixes g for gigabytes, m for megabytes, or k for kilobytes. Calling git config without any switches will set the setting just for this particular repository. Use the --global switch to set it globally for your user account or --system for all user accounts on the machine (this option requires root access).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.