Skip to content
MtrXTools

fatal: the remote end hung up unexpectedly

The Git server closed the connection

Seen in git clone, fetch, pull and push over HTTPS or SSH

The other end closed the connection in the middle of a git operation; the real reason is usually in the line printed just before it.

Common causes

  • A proxy or server size limit rejected a large push (look for RPC failed; HTTP 413 above it).
  • The network or a firewall dropped a long transfer (look for RPC failed; curl 18 or 56).
  • SSH authentication or access to the repository failed and the server disconnected.

How to fix it

  1. Read the error lines above this one and fix that cause first.
  2. Try the other transport (SSH instead of HTTPS, or the reverse) to see if one path is blocked.
  3. For big repositories, clone shallow (--depth 1) and fetch the rest later.

Got a different message? Paste it into the error explainer.

Related errors

All 31 Dev tools & SSH errors