I have googled and found many solutions but none work for me.
I am trying to clone from one machine by connecting to the remote server which is in the LAN network.
finally solved by git config --global core.compression 9
From a BitBucket issue thread:
I tried almost five times, and it still happen.
Then I tried to use better compression and it worked!
git config --global core.compression 9
From the Git Documentation:
core.compression
An integer -1..9, indicating a default compression level. -1 is the zlib default.
0 means no compression, and 1..9 are various speed/size tradeoffs, 9 being slowest.
If set, this provides a default to other compression variables, such as core.looseCompression and pack.compression.