Reputation: 8976
I've set up git on my Ubuntu 12.04 LTS but whenever I try to push files to my remote repository (git push -u origin master
), I get the following error-
ssh: connect to host github.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly
What does this mean? and How can I fix it?
I installed Git using the following-
sudo apt-get install git
My local repository is here-
/media/48B9-FD83/foobar
it is not in the home directory, it is on a mounted drive (is that a problem?).
I initialized git in that directory and followed the steps given here - GitHub's official tutorial.
And when pushing the files, I get those ssh
and fatal
errors, mentioned above.
How can I fix this?
Upvotes: 1
Views: 1182
Reputation: 9647
I had similar problems, always over WIFI, and I think I've found a after lots of searching. My solution is related to the Power Manager. You can check your settings by typing iwconfig
in ther terminal and you should see something like this:
wlan0 IEEE 802.11bgn ESSID:"MY_NET_NAME"
Mode:Managed Frequency:2.462 GHz Access Point: 00:00:00:00:00:00
Bit Rate=52 Mb/s Tx-Power=16 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=48/70 Signal level=-62 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:2 Invalid misc:27 Missed beacon:0
The problem is caused by Power Management:on
(if yours is not on, this solution is not for you).
To disable power management off, type the following in your terminal (replacing wlan0
with your device):
sudo iwconfig wlan0 power off
This fixed my problems. To make the solution permanent, you can add the solution to power manager's startup:
Hopefully that helps.
This is based on info I found here.
Upvotes: 0
Reputation: 12506
Try stuff in this order:
ping github.com
. You should not see any timeouts.sudo apt-get install telnet
.telnet github.com 22
. You should see something like this: Trying 204.232.175.90...
Connected to github.com.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.5p1 Debian-6+squeeze1+github9
Make sure ~/.ssh
and its contents are only readable to you by typing:
~/.ssh
~/.ssh/*
Next, ssh -T [email protected]
should say:
Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.
Report back if you see any error messages while trying any of these commands. Don't forget to post the error message you see in the comment.
Best of luck!
Upvotes: 2