The remote end hung up unexpectedly – Git + IntelliJ + Mac OS X

So I thought I’d try out IntelliJ’s neat little feature to import my project into a Github repo. Now I always used to do the git repo setup manually at the command line, and then commit and push my changes from the terminal too! But to speed things up, I thought I’d give this a bash. Only to be prompted with the following error in the Version Control pane in IntelliJ: There was a problem while connecting to
at com.trilead.ssh2.Connection.connect(
at com.trilead.ssh2.Connection.connect(
at org.jetbrains.git4idea.ssh.SSHMain.start(
at org.jetbrains.git4idea.ssh.SSHMain.main(
Caused by: Connection refused
at Method)
at com.trilead.ssh2.transport.TransportManager.establishConnection(
at com.trilead.ssh2.transport.TransportManager.initialize(
at com.trilead.ssh2.Connection.connect(
… 3 more
fatal: The remote end hung up unexpectedly

With a bit of searching and digging around on the net, I came across fatal: The remote end hung up unexpectedly and the obvious setup instructions on github. But the real gem that helped me out was Github (SSH) via public WIFI, port 22 blocked

I wouldn;t have originally thought that it would be because of the network I was connected to, but in desperation I resorted to looking around about ssh’ing on public networks, and eventually found this. For those who don’t feel like reading the StackOverflow question/answer, you basically just need to do the following:

Create the config

sudo nano ~/.ssh/config

Add the config

User YourEmail
Port 443

And Presto! When you push your changes from IntelliJ to Github, it’ll ask you if you trust this domain, and once you accept, all will be good with the world!