Spectre Kelevra
Spectre Kelevra

Reputation: 43

Unable to push to github, Remote end hung up unexpectedly

I'm trying to upload a relatively large Unreal engine 4 project through sourcecontrol on Github.

It uploads completely, and when it reaches 100% it fails giving me this error:

Writing objects: 100% (8901/8901), 11.30 GiB | 33.67 MiB/s   
Writing objects: 100% (8901/8901), 11.32 GiB | 31.25 MiB/s, done.
Total 8901 (delta 632), reused 8579 (delta 403)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; curl 56 Send failure: Connection was reset
Everything up-to-date

(The error was parsed as 4: The remote disconnected. Check your Internet connection and try again.)

My connection is fine, because I tried it several times, and it always fails at 100%.

I tried it with Sourcetree and Github Desktop, and it produces the same error.

Upvotes: 4

Views: 14347

Answers (2)

VonC
VonC

Reputation: 1328112

Check first if this is a client setting issue:

cd /path/to/your/repository
git config http.postBuffer 524288000

(and you can increase that setting since Git 2.13)

Also make sure to not exceed a GitHub size limit.

Upvotes: 17

mahee96
mahee96

Reputation: 841

Had this issue recently, when I was using the HTTPs url of the repo for push, later switched to SSH and it works like expected. My Repo size was 500MB and using SSH fixed it for me.

Setting up SSH keys if you don't have one

  1. create the SSH Key:
    ssh-keygen -t rsa -b 4096 -C "[email protected]"

  2. copy the key(everything) from the created public key file usually present in ".ssh/id_rsa.pub"

  3. logon to github and add the public key under
    settings->SSH_and_GPG_Keys->new_key

  4. after adding the public SSH Key into Github, test the SSH connection using
    ssh -vT [email protected]

Once you have your SSH ready.

  1. Setup upstream(push) remote URL which will be SSH url of the repo instead of usual HTTPS url.
    git remote add <remote-name> [email protected]:username/repo_name
  2. Set your branches to use the new upstream url
    git push --set-upstream <remote-name> <branch_name>
  3. Push the large repository as usual
    git push <remote-name> <branch_name>

Upvotes: 1

Related Questions