This tip may apply to I was working with git trying to push to github on Bluehost but this could generically apply to a lot of hosting companies. Previous tips didn't work.
After getting such errors as
Counting objects: 3532, done.
Delta compression using up to 24 threads.
fatal: unable to create thread: Resource temporarily unavailable
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: write error: Bad file descriptor
This let me send git commits on the shared host. It must forbid additional threads.
git config --global pack.threads "1"
Related issues and solution here: git push fatal: unable to create thread: Resource temporarily unavailable