https git clone与ssh git clone之间的区别

首先看一下两种使用方法的面相:

https git clone是长这样的:

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

ssh git clone是长这样的:

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

区别就是所用的协议不同:

  • https用443端口,可以对repo根据权限进行读写,只要有账号密码就可进行操作。
  • ssh则用的是22端口,也可以对repo根据权限进行读写,但是需要SSH Keys授权,这个key是通过ssh key生成器生成的,然后放在github上,作为授权的证据,这样的话就不需要用户名和密码进行授权了。

猜你喜欢

转载自blog.csdn.net/sinat_36246371/article/details/79885261