Why you failed to clone repository in GitHub ?

Written on 27 June 2015

When you join Github but do not know how git work and so much problem come to you. If you know how git work you can self solve your own problem.

But you just want to clone a git repository.
You have two choose:
1. Clone git repository using http, this is the easiest way.

git clone https://github.com/username/repo.git  

2. Clone using ssh , this is also a good way. But you must learn 1.

git clone git#github.com:username/repo.git  

To clone github repository using ssh, you must setup ssh key.
And test:

ssh -T [email protected]  
Hi username! You've successfully authenticated, but GitHub  
does not but GitHub does not provide shell access.  

If your test not same with prompt above, you must check you ssh config.

Here are some good tutorial to guide you how to configure Github use SSH

  1. How to clone Github repository https://help.github.com/articles/set-up-git/ ↩

  2. Generating Your SSH Public Key https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key ↩

  3. For a more in-depth tutorial on creating an SSH key on multiple operating systems, see the GitHub guide on SSH keys at https://help.github.com/articles/generating-ssh-keys. ↩

Read more on git Github Tech Note