1

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

ykhan21@LENOVO-LEGION:~/repos/homework-1-ykhan21$ 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
  • 163
  • 1
  • 2
  • 13

3 Answers3

2

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,490
  • 2
  • 17
  • 33
1

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
  • 163
  • 1
  • 2
  • 13
0

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
  • 396
  • 4
  • 8