2

I want to clone a repo of another person using ssh. For this I did following things:

  • Generated an ssh key in local machine.
  • Added the key to the user's account from which the repo has to be cloned.
  • Tested whether the key was added by running ssh -T [email protected] which outputs : Hi username! You've successfully authenticated, but GitHub does not provide shell access.
  • Ran git clone [email protected]:repo/repo.git.

The last step outputs Cloning into 'Foldername'... and I can see that the folder is created but no files are present in the folder. I left it for 1 hour but nothing was copied and I also checked the net but its working fine. I am using cygwin on windows to clone the repo.

What am I doing wrong?

4
  • How did you generate your ssh key? Did you add your public key to your account? Have you tried cloning any small public repos? Commented Aug 6, 2013 at 7:35
  • Yes I was cloning small repos in the morning with username and password which worked fine, but when I used ssh for cloning with [email protected]:repo/repo.git it just keeps giving cloning foldername.. . I have only added the public key to the remote users's account and is there a need to add the key to my account? Commented Aug 6, 2013 at 7:52
  • Who is this "remote user" you keep talking about? Are you trying to clone one of your own repos? Commented Aug 6, 2013 at 8:14
  • sorry for the misleading term, actually the repo is not in my account but in my colleague's account. I can't fork it in my account as then it will be public. So I added the key into that account not mine. Commented Aug 6, 2013 at 9:20

3 Answers 3

3

I have solved the problem. The problem was occurring because of different home directories of Git bash and cygwin.

When I generated the ssh key in my cygwin terminal the key was added to cygwin's .ssh folder which was C:\cygwin\home\windows\.ssh and when I ran the command ssh -T [email protected] it authenticated me using the ssh key which was in cygwin's .ssh directory.

But when I ran the command git clone [email protected]:repo/repo.git, the key in git bash's home directory was used which was in C:\Users\windows\.ssh. I copied the key present in cygwin's .ssh folder into this folder and everything worked fine.

However the weird thing is the git clone [email protected]:repo/repo.git command didn't threw any error but instead just hanged.

Sign up to request clarification or add additional context in comments.

1 Comment

+1. Good addition to my initial answer which was about the "private" nature of the fork.
2

I can't fork it in my account as then it will be public.

Nope: a private repo that you fork... would remain private!
This is detailed in "If I fork someone else's private Github repo into my account, is it going to appear in my account as a public repo?".

So if cloning from your account works, forking the repo of your colleague could be a good solution.

Comments

0

GitHub is currently experiencing downtime (see also https://status.github.com/), so that might be your issue:

We're investigating an increase in unicorns.

That's a humorous way to say that people are getting 404s on the pages on GitHub, because their 404 page has a unicorn on it:

enter image description here

It's not uncommon for GitHub to experience minor/major outages, probably because it's such a popular service. They also experience the occasional DDoS attack:

We're currently experiencing a large DDoS attack. The site is experiencing major ... See more at https://status.github.com/.

1 Comment

I am trying this for 2 days and was unable to clone it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.