In case you cannot clone your repository even in shallow mode it means that more memory is needed for git to fetch the files. The git output is similar to:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
ERROR: Timeout after 10 minutes ERROR: Error cloning remote repo 'origin' git fetch --tags --progress --depth=1 -- git@bitbucket.org:username/repo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: remote: Enumerating objects: 13045, done. remote: Counting objects: 0% (1/13045) remote: Counting objects: 1% (131/13045) ... Receiving objects: 98% (12804/13045), 360.22 MiB | 635.00 KiB/s Receiving objects: 98% (12804/13045), 360.95 MiB | 643.00 KiB/s fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed |
Again we see the same
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
but this time we may need to raise default packedGitWindowSize and windowMemory. To do this we add these lines to your global git configuration file, which is .gitconfig
in $USER_HOME
, in order to fix that problem.
1 2 3 4 5 6 7 |
[core] packedGitLimit = 512m packedGitWindowSize = 512m [pack] deltaCacheSize = 2047m packSizeLimit = 2047m windowMemory = 2047m |
This tweak allows Git to fetch bigger pack and fixes the issue!
Good luck!