If you have an alternative option to clone on http, run any of the below commands in gitbash and try to clone the repository, it should work.
git config --global http.postBuffer 524288000
git config --global http.postBuffer 1048576000
And, if you don't have the option of http and want to proceed with ssh.
You can configure SSH keepAlive either on the client or server.
Configure on server
Edit
~/.ssh/config
ServerAliveInterval 60
ServerAliveCountMax 5
Configure on client
Edit on /etc/ssh/sshd_config
ClientAliveInterval 60
ClientAliveCountMax 5
e.g.
echo 'ClientAliveInterval 60' | sudo tee --append /etc/ssh/sshd_config
EDIT:
git config --global ssh.postBuffer 1048576000
Try increasing the buffer, i face the same probelm in my repository.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…