Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .