Why does git:// works but git@ does not

前端 未结 2 1203
旧时难觅i
旧时难觅i 2021-01-11 12:39

Why does git:// works

$ git clone git://github.com/schacon/grit.git
Cloning into \'grit\'...
...
Checking connectivity... done.

but git@ do

相关标签:
2条回答
  • 2021-01-11 13:15

    Your first clone method is using the git protocol, the second is using SSH.

    You probably don't have your SSH token setup on github.com

    https://help.github.com/articles/generating-ssh-keys

    Gives you the steps on how to setup your user account for SSH use.

    You can see the differences between the protocols as they pertain to github here:

    https://gist.github.com/grawity/4392747

    0 讨论(0)
  • 2021-01-11 13:38

    This is because git@ uses ssh protocol. It is equivalent to ssh://git@.. So if you dont have correct ssh keys it will not work. Option git:// however uses git protocol which is similar to ssh but uses no authentication at all. See chapter on protocols for more information.

    0 讨论(0)
提交回复
热议问题