Sometimes, Git’s default buffer size is too small to handle large pushes. You can increase the buffer size to avoid timeouts by running:
git config --global http.postBuffer 524288000
This increases the buffer size to 500MB. If you’re pushing something very large, you might need to adjust this size further.