简体   繁体   English

为什么我们需要在git中使用SSH密钥?

[英]Why do we need SSH keys in git?

I am having a very little or no familiarity with git.I have been following a tutorial and there the person generate ssh keys, this was my first encounter with it. 我对git很少或根本不熟悉。我一直在关注一个教程,然后那个人生成了ssh密钥,这是我第一次遇到它。 Prior to it, i was following the command written in the git or adding it directly by JetBrains ide. 在此之前,我正在遵循git中编写的命令或直接通过JetBrains ide添加它。 I know it should be encrypting the connection but when uploading to GitHub, it means I am making my code public. 我知道它应该加密连接但是当上传到GitHub时,这意味着我正在公开我的代码。 Then why encryption? 那为什么要加密? Why going all these troubles in cmd. 为什么要在cmd中解决所有这些麻烦。

Why do we need SSH keys in git? 为什么我们需要在git中使用SSH密钥?

SSH keys identify the user that is interacting with the git remote repository. SSH密钥标识与git远程存储库交互的用户。

I know it should be encrypting the connection but when uploading to GitHub, it means I am making my code public. 我知道它应该加密连接但是当上传到GitHub时,这意味着我正在公开我的代码。

Not necessarily, there are private repositories in GitHub. 不一定,GitHub中有私有存储库。 Also, there are other hosting providers as well. 此外,还有其他托管服务提供商。

Why going all these troubles in cmd. 为什么要在cmd中解决所有这些麻烦。

With SSH authentication you don't need to enter your credentials when interacting with the remote. 使用SSH身份验证,您无需在与远程交互时输入凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM