I had the same problem, and this worked for me:
git gc --aggressive --prune
It took a while, but after it was done all git operations started working faster.
The push operation that previously failed then succeeded, probably because it became fast enough to avoid some timeout related issue.