这几天,有个同事上传了个1.5G的大文件,老是拉取失败,提示:
Out of memory, malloc failed (tried to allocate *** bytes).
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header
下面这种方法可以解决。
在项目的.git/config (服务器端位置为 data/git-data/repositories/**/**.git )里加入:
[core]
packedGitLimit = 128m
packedGitWindowSize = 128m
[pack]
deltaCacheSize = 128m
packSizeLimit = 128m
windowMemory = 128m
这个大小你觉得还不够。你还可以更调大一点。