fatal: read error: Connection reset by peer

Vijay13 picture Vijay13 · Jul 31, 2013 · Viewed 46.8k times · Source

Can some one help me to get rid of following:

vijay13@ubuntu:~$ git clone git://anongit.kde.org/plasma-mediacenter

Cloning into 'plasma-mediacenter'...

fatal: read error: Connection reset by peer

And

vijay13@ubuntu:~$ git clone [email protected]:plasma-mediacenter

Cloning into 'plasma-mediacenter'...

Read from socket failed: Connection reset by peer

fatal: The remote end hung up unexpectedly

How to get rid of both above issues?

Answer

user846316 picture user846316 · Dec 22, 2015

If internet connection is also fine, just run

git gc 

and try again. It cleans up unnecessary files and optimize the local repository. For more details: git documentation