Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push: fatal: the remote end hung up unexpectedly Connection to github.com closed by remote host

Tags:

git

github

ssh

push

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?


1 Answers

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
    • you can to remove the ssh origin and replace it with http
    • you may forgot to add your ssh key to your agent (ssh-add ~/.ssh/id_rsa)
    • you can re-run the steps described in the github documentation https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
  • 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
like image 117
mabe02 Avatar answered Oct 23 '25 21:10

mabe02



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!