| author | Alan Dipert
<alan@tailrecursion.com> 2026-02-04 16:14:10 UTC |
| committer | Alan Dipert
<alan@tailrecursion.com> 2026-02-04 16:14:10 UTC |
| parent | 41337a6cc9da5cf55c779fc609da55d095daefb3 |
| md/GitOnSharedHost.md | +28 | -0 |
diff --git a/md/GitOnSharedHost.md b/md/GitOnSharedHost.md index b4e8bc2..315587f 100644 --- a/md/GitOnSharedHost.md +++ b/md/GitOnSharedHost.md @@ -15,6 +15,34 @@ Recently I set up read-only Git repository hosting on [Dreamhost](https://www.dr 9. ``git push -u origin master`` 10. Now, you should be able to ``git push`` and anyone on the Internet should be able to ``git clone https://example.com/your-repo.git`` +## Cloning or fetch failures on shared hosts +On shared hosting, ``git clone`` or ``git fetch`` over SSH can fail with errors like: +- ``fatal: unable to create thread: Resource temporarily unavailable`` +- ``git upload-pack: git-pack-objects died with error`` +- ``fatal: early EOF`` +- misleading messages about possible repository corruption + +These errors are misleading. The repository is usually fine. The real issue is strict process and thread limits on shared hosting. When Git tries to pack objects with multiple threads, ``git pack-objects`` can exceed those limits and die. + +Force single-threaded packing on the server: + +``` +git config --global pack.threads 1 +``` + +Optional conservative memory limits that are often needed on shared hosts: + +``` +git config --global pack.windowMemory 10m +git config --global pack.packSizeLimit 50m +``` + +These settings are safe defaults for shared hosts and avoid the thread limit failures. + +If SSH cloning still fails, fall back to: + +- Shallow clones (``git clone --depth 1``) +- ``git bundle`` to transfer repositories when SSH cloning is unreliable