'How can I resolve "Recv failure: Connection reset by peer" error

I'm trying $ git pull or $ git fetch command on myRepo gives me error but myTestRepo works fine.

Commands give me that error.

Fetching origin
fatal: unable to access 'http://mysite/myPath/myRepo.git/': Recv failure: Connection reset by peer
error: Could not fetch origin

I tried git $ git fetch -p and $ git fetch -p --all -f command, they worked one or two times after that that commands give the same error.



Solution 1:[1]

I encounter similar problem but figure it out. Actually, there is no http but https for github. Try to replace http to https.

Solution 2:[2]

It could happen if 80 is blocked when you are using http url.

Solution 3:[3]

I was having this problem with

git clone xyz.git

I solve it adding the sudo commando

sudo git clone xyz.git

Solution 4:[4]

If your company uses github through a proxy then:

In your user .gitconfig file, include the proxy URL that corresponds to HTTPS.

Like the following example:

[https]
    proxy = https://YOUR_HTTPS_PROXY:PORT_NUMBER

or just run

git config --global https.https://domain.com.proxy https://proxyUsername:[email protected]:port

You can see more here:

https://gist.github.com/evantoli/f8c23a37eb3558ab8765

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tengerye
Solution 2 SharadTalekar
Solution 3 Henrique da Costa
Solution 4 Franco