7

I am trying to push to my remote git repository that I cloned using SSH, but I can't push to it. I get the following error:

fatal: Remote end hung up unexpectedly

I have done some searching and found that most people had to do git config ssh.postBuffer 524288000, but this has not worked for me; I still get the same error.

I am running my local repository on Levinux (because my university course requires it). I generated my SSH key and added it to GitHub already. Connecting using https works, but I'd rather use SSH. Any suggestions would be great!

2 Answers 2

9

For me, once I got the key to show up in the Help>Show SSH Key dialog box and

ssh -T [email protected]

was working fine; however when I ran

git remote -v

I could see that the repo was cloned from the https://github.com/ URL; not ssh://[email protected]/

origin https://github.com/User/Project.git (fetch)
origin https://github.com/User/Project.git (push)

So, I had to do

git remote set-url --push origin '[email protected]:User/Project.git'

and then Git GUI and TUI were both pushing just fine.

4

It appears that your SSH key from the machine you are using is not associated with your GitHub account. A way to verify this is to run the command

ssh [email protected]

If you see output along the lines of

PTY allocation request failed on channel 0
Hi rdthomson! You've successfully authenticated, but GitHub does not
provide shell access.
Connection to github.com closed.

then your key is configured correctly.

3
  • 1
    Thanks Greg! Tried generating the SSH key on a different machine and it worked so there must be something odd with the SSH key that was generated on the Levinux machine we have to use.
    – rdthomson
    Sep 14, 2017 at 20:51
  • @rdthomson You're welcome! I'm glad my suggestion helped.
    – Greg Bacon
    Sep 14, 2017 at 20:53
  • @rdthomson Which format (dsa | ecdsa | ed25519 | rsa | rsa1) and how many bits in each key?
    – o11c
    Sep 14, 2017 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.