Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

git clone hangs forever on github

Writer Andrew Henderson

When I follow point 5 (Test everything out) in the github guide, the ssh command also hangs forever. According to the guide, I should be presented with a message that "Github does not provide shell access". Below is my output from ssh -vT

debug1: Authentication succeeded (publickey).
Authenticated to github.com ([207.97.227.239]:22).
debug1: channel 0: new [client-session]
debug1: Requesting
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_MESSAGES = en_US.UTF-8
debug1: Sending env LC_COLLATE = en_US.UTF-8
debug1: Sending env LANG = da_DK.UTF-8
debug1: Sending env LC_CTYPE = en_US.UTF-8
4

13 Answers

GitHub offers a few different ways to connect to the remote repo. I am behind an onerous firewall. All methods also hang except using http (not https).

For example, the JavaHamcrest project offers (anonymously):

  • :hamcrest/JavaHamcrest.git
  • git://

You may also try:

Finally, prefix your UNIX command with GIT_TRACE=1 and GIT_CURL_VERBOSE=1, and use Git option --verbose for maximum debug output.

Example: env GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone --verbose

2

In my case port 22 was being blocked by a firewall, cloning via https may not work if you have 2-factor authentication enabled. Instead edit your .ssh config to use another port. In your terminal:

nano ~/.ssh/config

then add this:

Host github.com Hostname ssh.github.com Port 443
3

Try using HTTPS instead of SSH. Port 22 might be blocked by a firewall.

E.g. instead of:

git clone :repo-owner/my-project.git

Connect via HTTPS:

git clone 
2

I think I found the error. The WiMAX router I am using, messes SSH up. After trying another internet connection, it went smooth. The WiMAX router is branded "Alvarion", and according to a Danish Google Group the NAT implementation is broken in the router: .

I have contacted the internet supplier to look into this. If they prove it has nothing to do with their router I will post it here.

Thank you all for your comments, which made me realise it maybe was an infrastructure problem.

3

Make sure that you have ssh installed.

Ubuntu: sudo apt-get install ssh

1

I had the same issue on Xubuntu. Doing ssh -Tv hangs forever. Disabling the firewall with sudo ufw disable solved the problem.

Was having the same issue on Windows / msys2. Seems to be something with the router. I pinged github.com and then cloned using my username

git clone

and it worked. Not sure if its a one-off yet.

In my case I found that my Anti-Virus was blocking access to Github. The popup appeared behind all my windows which I did not realize earlier. The moment I allowed access to GitHub "ssh -vT " command worked. I was also able to clone a repository and push my code from local to Github.

Things to check when git clone and git push hang forever no error message

  • you already have SSH keys configured for you github account - also check that you github account has ssh keys -
  • your firewall/antivirus is not blocking your traffic

In my case was IPV6 blocking cloning, I disable ipv6 on ssh and works

Mine dumb case was that, I changed default SSH port in /etc/ssh/ssh_config instead of /etc/ssh/sshd_config 🙈

in my case my /etc/resolv.conf was messed up, i noticed pc would fail to even ping google.com. Fixed that that and life was grand.

I was just struggling with that (after updating to using API Token instead of password, changes on github since July'21)

What helped me was to use http instead of https in git clone.

Simple as that.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy