Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git clone hangs forever on github

Tags:

git

github

ssh

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 [email protected]

debug1: Authentication succeeded (publickey).
Authenticated to github.com ([207.97.227.239]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
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
like image 521
rvange Avatar asked Jan 05 '12 22:01

rvange


People also ask

Why is cloning taking so long?

Part 3: Why Does Cloning Process Take So Long? Cloning your disk requires not only the right software but also that all your hardware and your operating system are in good condition; otherwise, this procedure will take longer than it should.

Why Git clone is not working?

If you have a problem cloning a repository, or using it once it has been created, check the following: Ensure that the user has gone through initial GitCentric login and has the correct username, email, and ssh. This should return a usage message that refers to the config-branch, config-repo, and ls-repo commands.

How do you copy a remote repository?

To Git clone a repository navigate to your preferred repository hosting service like GitHub, select the repository you want to clone, copy the repository URL via HTTPS or SSH, type git clone in the command line, paste the URL, and hit enter .


3 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):

  • https://github.com/hamcrest/JavaHamcrest.git
  • [email protected]:hamcrest/JavaHamcrest.git
  • git://github.com/hamcrest/JavaHamcrest.git

You may also try:

  • http://github.com/hamcrest/JavaHamcrest.git

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 http://github.com/hamcrest/JavaHamcrest.git

like image 87
kevinarpe Avatar answered Oct 19 '22 09:10

kevinarpe


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
like image 41
Hom Bahrani Avatar answered Oct 19 '22 07:10

Hom Bahrani


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

E.g. instead of:

git clone [email protected]:repo-owner/my-project.git

Connect via HTTPS:

git clone https://[email protected]/repo-owner/my-project.git
like image 28
chribsen Avatar answered Oct 19 '22 07:10

chribsen