Skip to content

How to fix Git error "client_loop: send disconnect: Connection reset by peer"

Programming1 min read

When I tried to push my git branch to remote, I was getting this error:

1$ git push --set-upstream origin my-branch
2Enumerating objects: 845, done.
3Counting objects: 100% (845/845), done.
4Delta compression using up to 16 threads
5Compressing objects: 100% (725/725), done.
6Writing objects: 100% (771/771), 1.20 MiB | 2.22 MiB/s, done.
7Total 771 (delta 442), reused 0 (delta 0), pack-reused 0
8client_loop: send disconnect: Connection reset by peer
9fatal: the remote end hung up unexpectedly

It looks like a connection issue, but that was not the case at all.

The fix was simple: do a git pull to merge changes with remote. Then push again.

That was easy.

Did you enjoy this post?

Sign up for my newsletter

© 2021 remjx. All rights reserved.