usually encounter mmap/malloc memory space shortage errors in git.
To fix this issue, we have to upgrade git version to 1.7.10+ and add the following settings to ~/.gitconfig
[core]
packedGitWindowSize = 128m
packedGitLimit = 128m
bigFileThreshold = 128m
[pack]
compression = 1
windowMemory = 128m
threads = 1
window = 1
depth = 1
deltaCacheSize = 1
packSizeLimit = 128m