1

On my macOS laptop I can do a git clone like so:

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

And it doesn't require a username and password. My assumption is that this works because I have added my SSH key to github.

I have recently set up a new ubuntu machine, and I have generated a new SSH key and added it to github. However whenever I try too clone a repository, it asks me for my github username and password.

I have even tried copying my SSH key and ~/.ssh/config from my other machine, and I still get the same result.

Is there something I am missing to make it work without a password?

sak
  • 2,612
  • 24
  • 55
  • Please [edit] your question to show the specific git command that you're running and the exact messages which it prints. – Kenster Mar 29 '20 at 12:48

1 Answers1

0

The command you mention clones via HTTPS. To clone via SSH, use:

git clone git@github.com:my/repo.git

This command can also be copy pasted from the "Clone or download" option on your repository page and then selecting "Use SSH".

GoodDeeds
  • 7,956
  • 5
  • 34
  • 61
  • I am aware of this solution, but it won't work in my case. I am trying to install a vim plugin, and the plugin manager chooses the git URL itself, and doesn't provide an opportunity to enter the credentials – sak Mar 29 '20 at 15:03
  • @sak I am not aware of a workaround then, sorry. Perhaps you could take a look at [this thread](https://stackoverflow.com/q/10054318/5987698). Maybe your vim plugin manager expects the github repo to be public. – GoodDeeds Mar 29 '20 at 15:08
  • Thanks for the link and for your time! – sak Mar 30 '20 at 07:46