2

I'm using ssh and RSA keys to access github, but it doesn't work when I push files to the repository.

somename54@THISPC:~/repos/homework-1-name54$ git push
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 2.79 KiB | 2.79 MiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Connection to github.com closed by remote host.

How can I fix this?

thegoodhunter-9115
  • 317
  • 1
  • 3
  • 15

3 Answers3

3

You can use this question as a reference: Git, fatal: The remote end hung up unexpectedly

  • some users face this problem comes due to the buffer settings: e.g. git config ssh.postBuffer 524288000
  • you may have misconfigured you remote in the repo (you can check with git remote -v) or the ssh keypair
  • in other cases, running the garbage collector fixed the issue (git gc)
  • you may have missing writing permissions if you created the repository as root (sudo) and git is installed for your user
mabe02
  • 2,676
  • 2
  • 20
  • 35
  • 1
    `git config ssh.postBuffer 524288000` made it for me. – herve Jul 30 '21 at 09:18
  • Uh, I don't think `ssh.postBuffer` is a config setting. Maybe you're thinking of https://git-scm.com/docs/git-config#Documentation/git-config.txt-httppostBuffer – Michael Kropat Sep 01 '22 at 15:35
3

I found out that the this error usually happens when your files are too big. But my files were not, and I was able to push all of my other projects. Re-cloning into a separate directory helped, but it did not fix the original issue.

thegoodhunter-9115
  • 317
  • 1
  • 3
  • 15
1

I also encountered this issue when trying to push a commit, but I was able to push and pull from my other branches. When I tried again to push on the branch that was having the issue, it was successful.

Ukpa Uchechi
  • 604
  • 1
  • 6
  • 10